@nocobase/cli 2.1.25 → 2.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
1
  add_header Cache-Control "public" always;
2
+ add_header Content-Security-Policy "sandbox" always;
2
3
  add_header X-Content-Type-Options "nosniff" always;
3
4
 
4
5
  access_log off;
5
6
  autoindex off;
6
7
 
7
8
  # Force potentially renderable uploaded files to download.
8
- location ~* \.(?:htm|html|svg|svgz|xhtml)$ {
9
+ location ~* \.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$ {
9
10
  add_header Cache-Control "public" always;
11
+ add_header Content-Security-Policy "sandbox" always;
10
12
  add_header X-Content-Type-Options "nosniff" always;
11
13
  add_header Content-Disposition "attachment" always;
12
14
  }
@@ -16,6 +18,7 @@ location ~* \.md$ {
16
18
  default_type text/markdown;
17
19
 
18
20
  add_header Cache-Control "public" always;
21
+ add_header Content-Security-Policy "sandbox" always;
19
22
  add_header X-Content-Type-Options "nosniff" always;
20
23
  add_header Content-Disposition "inline" always;
21
24
  }
@@ -1000,15 +1000,17 @@ function renderNginxLocationTemplate(context) {
1000
1000
  default_type text/markdown;
1001
1001
  add_header Cache-Control "public";
1002
1002
  add_header Content-Disposition "inline";
1003
+ add_header Content-Security-Policy "sandbox" always;
1003
1004
  add_header X-Content-Type-Options "nosniff" always;
1004
1005
  access_log off;
1005
1006
  autoindex off;
1006
1007
  }
1007
1008
 
1008
- location ~* ^${context.appPublicPath}storage/uploads/(.*\\.(?:htm|html|svg|svgz|xhtml|pdf))$ {
1009
+ location ~* ^${context.appPublicPath}storage/uploads/(.*\\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt))$ {
1009
1010
  alias ${context.uploadsPath}/$1;
1010
1011
  add_header Cache-Control "public";
1011
1012
  add_header Content-Disposition "attachment" always;
1013
+ add_header Content-Security-Policy "sandbox" always;
1012
1014
  add_header X-Content-Type-Options "nosniff" always;
1013
1015
  access_log off;
1014
1016
  autoindex off;
@@ -1017,6 +1019,7 @@ function renderNginxLocationTemplate(context) {
1017
1019
  location ${context.appPublicPath}storage/uploads/ {
1018
1020
  alias ${context.uploadsPath}/;
1019
1021
  add_header Cache-Control "public";
1022
+ add_header Content-Security-Policy "sandbox" always;
1020
1023
  add_header X-Content-Type-Options "nosniff" always;
1021
1024
  access_log off;
1022
1025
  autoindex off;
@@ -1136,10 +1139,14 @@ function renderCaddyAppTemplate(siteAddress, context, publicDir) {
1136
1139
  `${siteAddress} {`,
1137
1140
  ` encode zstd gzip${rootRedirectBlock}${appPublicPathRedirectBlock}${modernClientRedirectBlock}${shorthandModernClientRedirectBlock}`,
1138
1141
  '',
1142
+ ' @activeUploadedContent path_regexp activeUploadedContent (?i)\\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$',
1143
+ '',
1139
1144
  ` handle_path ${uploadsPathMatcher} {`,
1140
1145
  ` root * ${context.uploadsPath}`,
1141
1146
  ' header Cache-Control public',
1147
+ ' header Content-Security-Policy sandbox',
1142
1148
  ' header X-Content-Type-Options nosniff',
1149
+ ' header @activeUploadedContent Content-Disposition attachment',
1143
1150
  ' file_server',
1144
1151
  ' }',
1145
1152
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "2.1.25",
3
+ "version": "2.1.26",
4
4
  "description": "NocoBase Command Line Tool",
5
5
  "type": "module",
6
6
  "main": "dist/generated/command-registry.js",
@@ -144,5 +144,5 @@
144
144
  "type": "git",
145
145
  "url": "git+https://github.com/nocobase/nocobase.git"
146
146
  },
147
- "gitHead": "f3326a2681004deee97b563fb6ab04744e26ac71"
147
+ "gitHead": "b25700115794487b342ac33a63a1a988c75c112c"
148
148
  }