@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 +1 -1
- package/README.md +1 -1
- package/index.js +4 -2
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
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-
|
|
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
|
-
|
|
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.
|
|
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": "
|
|
65
|
+
"gitHead": "e862f8d6cbd447461537bc8e8db39c6720290e2f",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@middy/util": "5.4.
|
|
67
|
+
"@middy/util": "5.4.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@middy/core": "5.4.
|
|
70
|
+
"@middy/core": "5.4.2"
|
|
71
71
|
}
|
|
72
72
|
}
|