aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHenri D <nheir.kim@gmail.com>2022-10-08 08:42:36 +0200
committerGitHub <noreply@github.com>2022-10-08 09:42:36 +0300
commit8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1 (patch)
tree2b02503d3b3ad527bb4e2b746a3438b43c1bcca3 /test
parent26b524e1d7b9a00045882d3c0f25486485b1d6a8 (diff)
downloadluasocket-8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1.tar.gz
luasocket-8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1.tar.bz2
luasocket-8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1.zip
fix(http): Allow relative redirect on https (#395)
Location header can now be relative: https://httpwg.org/specs/rfc9110.html#field.location
Diffstat (limited to 'test')
-rw-r--r--test/httptest.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/httptest.lua b/test/httptest.lua
index 63ff921..3457b07 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -265,6 +265,37 @@ ignore = {
265} 265}
266check_request(request, expect, ignore) 266check_request(request, expect, ignore)
267 267
268-- Use https://httpbin.org/#/Dynamic_data/get_base64__value_ for testing
269-----------------------------------------------------
270io.write("testing absolute https redirection: ")
271request = {
272 url = "https://httpbin.org/redirect-to?url=https://httpbin.org/base64/THVhIFNvY2tldA=="
273}
274expect = {
275 code = 200,
276 body = "Lua Socket"
277}
278ignore = {
279 status = 1,
280 headers = 1
281}
282check_request(request, expect, ignore)
283
284-----------------------------------------------------
285io.write("testing relative https redirection: ")
286request = {
287 url = "https://httpbin.org/redirect-to?url=/base64/THVhIFNvY2tldA=="
288}
289expect = {
290 code = 200,
291 body = "Lua Socket"
292}
293ignore = {
294 status = 1,
295 headers = 1
296}
297check_request(request, expect, ignore)
298
268------------------------------------------------------------------------ 299------------------------------------------------------------------------
269--[[ 300--[[
270io.write("testing proxy with redirection: ") 301io.write("testing proxy with redirection: ")