@middy/http-security-headers 2.5.1 → 2.5.5

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.
Files changed (2) hide show
  1. package/index.js +10 -1
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -6,6 +6,9 @@ const {
6
6
 
7
7
 
8
8
  const defaults = {
9
+ // contentDisposition: {
10
+ // filename: undefined
11
+ // },
9
12
  dnsPrefetchControl: {
10
13
  allow: false
11
14
  },
@@ -43,7 +46,13 @@ const defaults = {
43
46
  }
44
47
  };
45
48
  const helmet = {};
46
- const helmetHtmlOnly = {}; // contentSecurityPolicy - N/A - no HTML
49
+ const helmetHtmlOnly = {}; // OWASP ASVS 14.4.2
50
+ // API Gateway strips out this header :(
51
+ // helmet.content = (headers, config) => {
52
+ // const filename = config.filename ?? `api.${headers?.['Content-Type'].split(/[/;]/)[1] ?? 'json'}`
53
+ // headers['Content-Disposition'] = `attachment; filename="${filename}"`
54
+ // }
55
+ // contentSecurityPolicy - N/A - no HTML
47
56
  // featurePolicy - N/A - no HTML
48
57
  // crossdomain - N/A - For Adobe products
49
58
  // https://github.com/helmetjs/dns-Prefetch-control
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-security-headers",
3
- "version": "2.5.1",
3
+ "version": "2.5.5",
4
4
  "description": "Applies best practice security headers to responses. It's a simplified port of HelmetJS",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -48,11 +48,11 @@
48
48
  "url": "https://github.com/middyjs/middy/issues"
49
49
  },
50
50
  "homepage": "https://github.com/middyjs/middy#readme",
51
- "gitHead": "df18e5eff7d73492a96a2ca4780a2eae45d1cedb",
51
+ "gitHead": "b84840ec8afd289f6decfd0d645be4899051792d",
52
52
  "dependencies": {
53
- "@middy/util": "^2.5.1"
53
+ "@middy/util": "^2.5.5"
54
54
  },
55
55
  "devDependencies": {
56
- "@middy/core": "^2.5.1"
56
+ "@middy/core": "^2.5.5"
57
57
  }
58
58
  }