Skip to content

Commit

Permalink
fix(test): repo moved, update location
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Mar 2, 2024
1 parent 46f4a2b commit b304afd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/httpredirect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ local done = false

copas.addthread(function()
local _, code, headers = doreq("https://goo.gl/UBCUc5") -- https --> https redirect
assert(tonumber(code)==200)
assert(headers.location == "https://github.com/brunoos/luasec")
assert(tonumber(code)==200, "unexpected status code: "..tostring(code))
assert(headers.location == "https://github.com/lunarmodules/luasec", "unexpected location header: "..tostring(headers.location))
print("https -> https redirect OK!")
copas.addthread(function()
local _, code, headers = doreq("http://goo.gl/UBCUc5") -- http --> https redirect
assert(tonumber(code)==200)
assert(headers.location == "https://github.com/brunoos/luasec")
assert(tonumber(code)==200, "unexpected status code: "..tostring(code))
assert(headers.location == "https://github.com/lunarmodules/luasec", "unexpected location header: "..tostring(headers.location))
print("http -> https redirect OK!")
copas.addthread(function()
--local result, code, headers, status = doreq("http://goo.gl/tBfqNu") -- http --> http redirect
Expand All @@ -63,7 +63,7 @@ copas.addthread(function()
-- execute test request
local _, code, headers = doreq("http://localhost:9876/") -- http --> http redirect
copas.removeserver(server) -- immediately close server again
assert(tonumber(code)==200)
assert(tonumber(code)==200, "unexpected status code: "..tostring(code))
assert(headers.location == "http://www.httpvshttps.com")
print("http -> http redirect OK!")
copas.addthread(function()
Expand All @@ -73,7 +73,7 @@ copas.addthread(function()
copas.addthread(function()
redirect = "all"
local _, code, headers = doreq("https://bit.ly/3vmhXhW") -- https --> http security test case
assert(tonumber(code)==200)
assert(tonumber(code)==200, "unexpected status code: "..tostring(code))
assert(headers.location == "http://www.httpvshttps.com/")
print("https -> http redirect, while allowed OK!")
done = true
Expand Down

0 comments on commit b304afd

Please sign in to comment.