New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@middy/http-security-headers

Package Overview
Dependencies
Maintainers
3
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/http-security-headers - npm Package Compare versions

Comparing version 2.0.0-alpha.6 to 2.0.0-beta.0

47

index.d.ts
import middy from '@middy/core'
interface IHTTPSecurityHeadersOptions {
interface Options {
dnsPrefetchControl?: {
allow?: Boolean
},
allow?: boolean
}
expectCT?: {
enforce?: Boolean,
maxAge?: Number
},
enforce?: boolean
maxAge?: number
reportUri?: string
}
frameguard?: {
action?: String
},
action?: string
}
hidePoweredBy?: {
setTo: String
},
setTo: string
}
hsts?: {
maxAge?: Number,
includeSubDomains?: Boolean,
preload?: Boolean
},
maxAge?: number
includeSubDomains?: boolean
preload?: boolean
}
ieNoOpen?: {
action?: String
},
action?: string
}
noSniff?: {
action?: String
},
action?: string
}
referrerPolicy?: {
policy?: String
},
xssFilter?: Object
policy?: string
}
xssFilter?: {
reportUri?: string
}
}
declare const httpSecurityHeaders : middy.Middleware<IHTTPSecurityHeadersOptions, any, any>
declare function httpSecurityHeaders (options?: Options): middy.MiddlewareObj
export default httpSecurityHeaders

@@ -14,4 +14,4 @@ "use strict";

enforce: true,
maxAge: 30 // reportUri: ''
maxAge: 30,
reportUri: ''
},

@@ -42,3 +42,4 @@ frameguard: {

},
xssFilter: {// reportUri: ''
xssFilter: {
reportUri: ''
}

@@ -135,4 +136,4 @@ };

const httpSecurityHeadersMiddlewareAfter = async handler => {
handler.response = normalizeHttpResponse(handler.response);
const httpSecurityHeadersMiddlewareAfter = async request => {
request.response = normalizeHttpResponse(request.response);
Object.keys(helmet).forEach(key => {

@@ -142,6 +143,6 @@ const config = { ...defaults[key],

};
handler.response.headers = helmet[key](handler.response.headers, config);
request.response.headers = helmet[key](request.response.headers, config);
});
if (handler.response.headers['Content-Type'] && handler.response.headers['Content-Type'].indexOf('text/html') !== -1) {
if (request.response.headers['Content-Type'] && request.response.headers['Content-Type'].indexOf('text/html') !== -1) {
Object.keys(helmetHtmlOnly).forEach(key => {

@@ -151,3 +152,3 @@ const config = { ...defaults[key],

};
handler.response.headers = helmetHtmlOnly[key](handler.response.headers, config);
request.response.headers = helmetHtmlOnly[key](request.response.headers, config);
});

@@ -154,0 +155,0 @@ }

{
"name": "@middy/http-security-headers",
"version": "2.0.0-alpha.6",
"version": "2.0.0-beta.0",
"description": "Applies best practice security headers to responses. It's a simplified port of HelmetJS",

@@ -20,4 +20,3 @@ "type": "commonjs",

"test": "npm run test:typings && npm run test:unit",
"test:unit": "ava",
"test:typings": "typings-tester --config tsconfig.json index.d.ts"
"test:unit": "ava"
},

@@ -53,6 +52,9 @@ "license": "MIT",

"homepage": "https://github.com/middyjs/middy#readme",
"gitHead": "e6ab94a1f33ca215f63ee613bc9469ccd56caf21",
"gitHead": "cf78e46ea77bf8feb3ae6061d8e8e9a02f8eeb2e",
"dependencies": {
"@middy/util": "^2.0.0-alpha.6"
"@middy/util": "^2.0.0-beta.0"
},
"devDependencies": {
"@middy/core": "^2.0.0-beta.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc