diff options
| author | Amanda Stjerna <amanda@stjerna.space> | 2026-08-31 10:17:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-31 08:17:14 +0000 |
| commit | af10c2ceb0633082d711104e5dac53998d5fe7c9 (patch) | |
| tree | cf0fa0534ec7af16333534e45f1fa84ec3249fc2 /src | |
| parent | 8e00f02f24d8618fcbff42c93a7ee512f694cc2f (diff) | |
| download | luasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.tar.gz luasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.tar.bz2 luasocket-af10c2ceb0633082d711104e5dac53998d5fe7c9.zip | |
feat(core): Handle response code 308 permanent redirect
Diffstat (limited to 'src')
| -rw-r--r-- | src/http.lua | 2 |
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) |
