mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-11-22 00:05:57 -05:00
add test to verify that redirect plugin can follow relative and with .. paths
This commit is contained in:
parent
949bcdbc2a
commit
159fa74a3f
@ -23,6 +23,16 @@ module Requests
|
||||
verify_status(response, 304)
|
||||
end
|
||||
|
||||
def test_plugin_follow_redirects_relative_path
|
||||
session = HTTPX.plugin(:follow_redirects)
|
||||
uri = redirect_uri("../get")
|
||||
|
||||
redirect_response = session.get(uri)
|
||||
body = json_body(redirect_response)
|
||||
assert body.key?("url"), "url should be set"
|
||||
assert body["url"] == redirect_location, "url should have been the given redirection url"
|
||||
end
|
||||
|
||||
def test_plugin_follow_redirects_default_max_redirects
|
||||
session = HTTPX.plugin(:follow_redirects)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user