Skip to content

Commit ce8233b

Browse files
committed
fix: common filters
1 parent ff6eb03 commit ce8233b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/common.filter.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Allow load ab2p resources from sites with CSP policies applied
22
SERVER-HEADER-FILTER: allow-custom-css "Add ${NGINX_SERVER_NAME} to style-src in CSP"
3-
s/(style-src\s+)([^;]*)(;)/$1$2 ${NGINX_SERVER_NAME}$3/gmi
4-
s/^Content-Security-Policy:\s+(?!.*style-src)(.*)$/Content-Security-Policy: $1; style-src ${NGINX_SERVER_NAME}/mi
3+
s/(style-src\s+)(?![^;]*${NGINX_SERVER_NAME})([^;]*)(;)/$1$2 ${NGINX_SERVER_NAME}$3/gmi
4+
s/^Content-Security-Policy:\s+(?!.*style-src)(.*?)(default-src\s+)(?![^;]*${NGINX_SERVER_NAME})([^;]*)(;)/Content-Security-Policy: $1$2$3 ${NGINX_SERVER_NAME}$4/mi

0 commit comments

Comments
 (0)