fix: replace lua patterns for content type check
This commit is contained in:
parent
0214a278da
commit
b7cf5a5084
1 changed files with 5 additions and 4 deletions
|
@ -11,10 +11,11 @@ if ngx.header["Content-Type"] then
|
||||||
content_type:find("text/xml") or
|
content_type:find("text/xml") or
|
||||||
content_type:find("application/javascript") or
|
content_type:find("application/javascript") or
|
||||||
content_type:find("application/json") or
|
content_type:find("application/json") or
|
||||||
content_type:find("application/rss+xml") or
|
content_type:find("application/rss%+xml") or
|
||||||
content_type:find("application/atom+xml") or
|
content_type:find("application/atom%+xml") or
|
||||||
content_type:find("application/vnd.mpegurl") or
|
content_type:find("application/vnd%.mpegurl") or
|
||||||
content_type:find("application/x-mpegurl") then
|
content_type:find("application/x%-mpegurl") then
|
||||||
|
ngx.log(ngx.DEBUG, "Enabling rewrite due to content type " .. content_type)
|
||||||
ngx.ctx.rewriting = true
|
ngx.ctx.rewriting = true
|
||||||
ngx.header["Content-Length"] = nil -- We're rewriting the body so this has the wrong value if set
|
ngx.header["Content-Length"] = nil -- We're rewriting the body so this has the wrong value if set
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue