Add integration test for 308 redirect

This commit is contained in:
Matthias Seiffert 2023-07-08 19:32:19 +02:00 committed by jcamiel
parent d32d492387
commit cef2e80c1a
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
6 changed files with 21 additions and 4 deletions

View File

@ -1 +1,2 @@
curl --location 'http://localhost:8000/follow-redirect'
curl --location --request POST 'http://localhost:8000/follow-redirect-308'

View File

@ -1,5 +1,8 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/follow-redirect</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="string">`Followed redirect!`</span></span>
</span></span><span class="line"></span>
</code></pre>
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/follow-redirect-308</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="string">`Followed redirect POST!`</span></span>
</span></span></code></pre>

View File

@ -2,3 +2,6 @@ GET http://localhost:8000/follow-redirect
HTTP 200
`Followed redirect!`
POST http://localhost:8000/follow-redirect-308
HTTP 200
`Followed redirect POST!`

View File

@ -1 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/follow-redirect"},"response":{"status":200,"body":{"type":"text","value":"Followed redirect!"}}}]}
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/follow-redirect"},"response":{"status":200,"body":{"type":"text","value":"Followed redirect!"}}},{"request":{"method":"POST","url":"http://localhost:8000/follow-redirect-308"},"response":{"status":200,"body":{"type":"text","value":"Followed redirect POST!"}}}]}

View File

@ -1 +1 @@
Followed redirect!
Followed redirect POST!

View File

@ -25,3 +25,13 @@ def following_redirect():
@app.route("/followed-redirect")
def followed_redirect():
return "Followed redirect!"
@app.route("/followed-redirect-post", methods=["POST"])
def followed_redirect_post():
return "Followed redirect POST!"
@app.route("/follow-redirect-308", methods=["POST"])
def follow_redirect_308():
return redirect("http://localhost:8000/followed-redirect-post", code=308)