@middy/http-security-headers 5.4.0 → 5.4.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell) and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
3
+ Copyright (c) 2017-2024 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell) and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  ## License
42
42
 
43
- Licensed under [MIT License](LICENSE). Copyright (c) 2017-2023 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
43
+ Licensed under [MIT License](LICENSE). Copyright (c) 2017-2024 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
44
44
 
45
45
  <a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
46
46
  <img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
package/index.js CHANGED
@@ -267,8 +267,10 @@ const httpSecurityHeadersMiddleware = (opts = {}) => {
267
267
  const config = { ...defaults[key], ...options[key] }
268
268
  helmet[key](request.response.headers, config)
269
269
  })
270
-
271
- if (request.response.headers['Content-Type']?.includes('text/html')) {
270
+ const contentTypeHeader =
271
+ request.response.headers['Content-Type'] ??
272
+ request.response.headers['content-type']
273
+ if (contentTypeHeader?.includes('text/html')) {
272
274
  Object.keys(helmetHtmlOnly).forEach((key) => {
273
275
  if (!options[key]) return
274
276
  const config = { ...defaults[key], ...options[key] }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-security-headers",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Applies best practice security headers to responses. It's a simplified port of HelmetJS",
5
5
  "type": "module",
6
6
  "engines": {
@@ -62,11 +62,11 @@
62
62
  "type": "github",
63
63
  "url": "https://github.com/sponsors/willfarrell"
64
64
  },
65
- "gitHead": "593d40bc87996159c29367ab39d7d415940d9fba",
65
+ "gitHead": "e862f8d6cbd447461537bc8e8db39c6720290e2f",
66
66
  "dependencies": {
67
- "@middy/util": "5.4.0"
67
+ "@middy/util": "5.4.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@middy/core": "5.4.0"
70
+ "@middy/core": "5.4.2"
71
71
  }
72
72
  }