@digest/koa 4.14.6 → 4.14.8-next.1

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.
package/dist/app.js CHANGED
@@ -12,13 +12,27 @@ const koa_remove_trailing_slashes_1 = __importDefault(require("koa-remove-traili
12
12
  const app = new koa_1.default();
13
13
  const router = (0, routers_1.default)();
14
14
  app.use((0, koa_helmet_1.default)()).use(router.routes()).use(router.allowedMethods()).use((0, koa_remove_trailing_slashes_1.default)());
15
- if (!scripts_1.production) {
15
+ if (scripts_1.production) {
16
+ app.use(koa_helmet_1.default.contentSecurityPolicy({
17
+ directives: {
18
+ scriptSrc: [
19
+ '\'self\'',
20
+ '\'wasm-unsafe-eval\''
21
+ ]
22
+ }
23
+ }));
24
+ }
25
+ else {
16
26
  app.use(koa_helmet_1.default.contentSecurityPolicy({
17
27
  directives: {
18
28
  defaultSrc: [
19
29
  '\'self\'',
20
30
  '\'unsafe-inline\''
21
31
  ],
32
+ scriptSrc: [
33
+ '\'self\'',
34
+ '\'wasm-unsafe-eval\''
35
+ ],
22
36
  upgradeInsecureRequests: null
23
37
  }
24
38
  }));
@@ -11,7 +11,7 @@ const history = (baseHref) => {
11
11
  strict: true
12
12
  });
13
13
  const historyMiddleware = (0, history_1.default)(baseHref);
14
- const historyBase = '(.*)';
14
+ const historyBase = '{*historyMiddleware}';
15
15
  router.get(historyBase, historyMiddleware);
16
16
  router.head(historyBase, historyMiddleware);
17
17
  router.options(historyBase, historyMiddleware);
@@ -12,7 +12,7 @@ const statics = (baseHref, staticPath, production = false, serveStaticOptions) =
12
12
  strict: true
13
13
  });
14
14
  const staticMiddleware = (0, statics_1.default)(baseHref, staticPath, production, serveStaticOptions);
15
- const staticBase = '(.*)';
15
+ const staticBase = '{*staticMiddleware}';
16
16
  router.get(staticBase, (0, koa_mount_1.default)(baseHref, staticMiddleware));
17
17
  router.head(staticBase, (0, koa_mount_1.default)(baseHref, staticMiddleware));
18
18
  router.options(staticBase, (0, koa_mount_1.default)(baseHref, staticMiddleware));
@@ -11,7 +11,7 @@ const stats = () => {
11
11
  strict: true
12
12
  });
13
13
  const statsMiddleware = (0, stats_1.default)();
14
- const statsPath = '/stats/(.*)';
14
+ const statsPath = '/stats/{*statsMiddleware}';
15
15
  router.get(statsPath, statsMiddleware);
16
16
  router.head(statsPath, statsMiddleware);
17
17
  router.options(statsPath, statsMiddleware);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@digest/koa",
3
3
  "title": "Koa Digest",
4
4
  "license": "LGPL-3.0-or-later",
5
- "version": "4.14.6",
5
+ "version": "4.14.8-next.1",
6
6
  "description": "Digested Koa configurations",
7
7
  "author": "wallzero @wallzeroblog (http://wallzero.com)",
8
8
  "contributors": [
@@ -74,5 +74,5 @@
74
74
  "digest",
75
75
  "koa"
76
76
  ],
77
- "gitHead": "af58088b1b1a805901a52dc502472269dde55367"
77
+ "gitHead": "2f4145c4391be317be01156076e642eeae4d4453"
78
78
  }