From 8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1 Mon Sep 17 00:00:00 2001 From: Henri D Date: Sat, 8 Oct 2022 08:42:36 +0200 Subject: fix(http): Allow relative redirect on https (#395) Location header can now be relative: https://httpwg.org/specs/rfc9110.html#field.location --- test/httptest.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test') 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 = { } 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: ") -- cgit v1.2.3-55-g6feb