fix: check for config before rewriting
This commit is contained in:
parent
b7cf5a5084
commit
5fe0739635
2 changed files with 42 additions and 38 deletions
|
@ -52,6 +52,7 @@ local function rewrite_body(body)
|
||||||
return body
|
return body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ngx.ctx.jasima_config then
|
||||||
if ngx.ctx.rewriting then
|
if ngx.ctx.rewriting then
|
||||||
local chunk = ngx.arg[1]
|
local chunk = ngx.arg[1]
|
||||||
local eof = ngx.arg[2]
|
local eof = ngx.arg[2]
|
||||||
|
@ -71,3 +72,4 @@ if ngx.ctx.rewriting then
|
||||||
ngx.arg[1] = nil
|
ngx.arg[1] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
local utils = require "utils"
|
local utils = require "utils"
|
||||||
|
|
||||||
|
if ngx.ctx.jasima_config then
|
||||||
if ngx.ctx.jasima_config.rewrite_disable then
|
if ngx.ctx.jasima_config.rewrite_disable then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -27,3 +28,4 @@ if ngx.header["Location"] then
|
||||||
ngx.header["Location"] = location:gsub("//([%a%d%.-]+%.[%a%d-]+)/+", utils.get_mirror)
|
ngx.header["Location"] = location:gsub("//([%a%d%.-]+%.[%a%d-]+)/+", utils.get_mirror)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue