fix(http): Allow relative redirect on https (#395)
Location header can now be relative: https://httpwg.org/specs/rfc9110.html#field.location
This commit is contained in:
parent
26b524e1d7
commit
8c2ff7217e
2 changed files with 34 additions and 2 deletions
|
@ -265,6 +265,37 @@ ignore = {
|
|||
}
|
||||
check_request(request, expect, ignore)
|
||||
|
||||
-- Use https://httpbin.org/#/Dynamic_data/get_base64__value_ for testing
|
||||
-----------------------------------------------------
|
||||
io.write("testing absolute https redirection: ")
|
||||
request = {
|
||||
url = "https://httpbin.org/redirect-to?url=https://httpbin.org/base64/THVhIFNvY2tldA=="
|
||||
}
|
||||
expect = {
|
||||
code = 200,
|
||||
body = "Lua Socket"
|
||||
}
|
||||
ignore = {
|
||||
status = 1,
|
||||
headers = 1
|
||||
}
|
||||
check_request(request, expect, ignore)
|
||||
|
||||
-----------------------------------------------------
|
||||
io.write("testing relative https redirection: ")
|
||||
request = {
|
||||
url = "https://httpbin.org/redirect-to?url=/base64/THVhIFNvY2tldA=="
|
||||
}
|
||||
expect = {
|
||||
code = 200,
|
||||
body = "Lua Socket"
|
||||
}
|
||||
ignore = {
|
||||
status = 1,
|
||||
headers = 1
|
||||
}
|
||||
check_request(request, expect, ignore)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
--[[
|
||||
io.write("testing proxy with redirection: ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue