Merge pull request #46 from ONLYOFFICE/bugfix/csp

Bugfix/csp
This commit is contained in:
Pavel Bannov 2023-11-09 00:39:53 -08:00 committed by GitHub
commit 81114fc467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,8 @@ server {
set $csp "";
access_by_lua '
if ngx.req.get_method() == "GET" then
local accept_header = ngx.req.get_headers()["Accept"]
if ngx.req.get_method() == "GET" and accept_header ~= nil and string.find(accept_header, "html") then
local key = string.format("csp:%s",ngx.var.host)
local redis = require "resty.redis"
local red = redis:new()