fix: always rewrite redirects regardless of content-type
This commit is contained in:
parent
d6e7ce13b0
commit
041891dc9a
1 changed files with 2 additions and 3 deletions
|
@ -15,13 +15,12 @@ if ngx.header["Content-Type"] then
|
|||
content_type:find("application/vnd.mpegurl") or
|
||||
content_type:find("application/x-mpegurl") then
|
||||
ngx.ctx.rewriting = true
|
||||
ngx.header["Content-Length"] = nil
|
||||
ngx.header["Content-Length"] = nil -- We're rewriting the body so this has the wrong value if set
|
||||
end
|
||||
end
|
||||
|
||||
if ngx.header["Location"] then
|
||||
local pool_map = ngx.ctx.jasima_pool_map
|
||||
if ngx.ctx.rewriting and pool_map then
|
||||
if ngx.ctx.jasima_pool_map then
|
||||
local location = ngx.header["Location"]
|
||||
ngx.header["Location"] = location:gsub("//([a-zA-Z0-9%.%-]+%.[a-zA-Z0-9]+)/", utils.get_mirror)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue