aboutsummaryrefslogtreecommitdiff
path: root/src/http.lua
diff options
context:
space:
mode:
authorAmanda Stjerna <amanda@stjerna.space>2026-08-31 10:17:14 +0200
committerGitHub <noreply@github.com>2026-08-31 08:17:14 +0000
commitaf10c2ceb0633082d711104e5dac53998d5fe7c9 (patch)
treecf0fa0534ec7af16333534e45f1fa84ec3249fc2 /src/http.lua
parent8e00f02f24d8618fcbff42c93a7ee512f694cc2f (diff)
downloadluasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.tar.gz
luasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.tar.bz2
luasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.zip
feat(core): Handle response code 308 permanent redirect
Diffstat (limited to 'src/http.lua')
-rw-r--r--src/http.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http.lua b/src/http.lua
index 263e621..21d3078 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -328,7 +328,7 @@ local function shouldredirect(reqt, code, headers)
328 -- avoid https downgrades 328 -- avoid https downgrades
329 if ('https' == reqt.scheme) and ('https' ~= scheme) then return false end 329 if ('https' == reqt.scheme) and ('https' ~= scheme) then return false end
330 return (reqt.redirect ~= false) and 330 return (reqt.redirect ~= false) and
331 (code == 301 or code == 302 or code == 303 or code == 307) and 331 (code == 301 or code == 302 or code == 303 or code == 307 or code == 308) and
332 (not reqt.method or reqt.method == "GET" or reqt.method == "HEAD") 332 (not reqt.method or reqt.method == "GET" or reqt.method == "HEAD")
333 and ((false == reqt.maxredirects) 333 and ((false == reqt.maxredirects)
334 or ((reqt.nredirects or 0) 334 or ((reqt.nredirects or 0)