{"_id":"strict-transport-security","_rev":"15-add770b343794988250289ca133271d4","name":"strict-transport-security","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"strict-transport-security","version":"0.1.0","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"_id":"strict-transport-security@0.1.0","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"bugs":{"url":"https://github.com/samuelerdtman/strict-transport-security/issues"},"dist":{"shasum":"8cf90c77778dec0f2f833e01b8107b09c79ad089","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.1.0.tgz","integrity":"sha512-6IweyZyL1XFV2xHBx+rGOdkXHQaXufyaAKrBov/C3o5nTk/RNCUNisjSnOzgcx2R+wSH0niPmE+gHnQF2DnF3A==","signatures":[{"sig":"MEQCIHPeVfP9l0p08x/E3thSwWCNRzshwnHVF3cnFGl8mJO8AiA2Xqxe89iss1kMndCftp6wfRucp3SHwabxpbaP3q3oCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib","_from":"./","engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha -u tdd"},"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git@github.com:samuelerdtman/strict-transport-security.git","type":"git"},"_npmVersion":"1.2.32","description":"Middleware to add Strict-Transport-Security header.","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.13.x"}},"0.2.0":{"name":"strict-transport-security","version":"0.2.0","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"_id":"strict-transport-security@0.2.0","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"bugs":{"url":"https://github.com/samuelerdtman/strict-transport-security/issues"},"dist":{"shasum":"3249c2b4af8c50e4a6c4b8ea35654cc9b59a1fe0","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.2.0.tgz","integrity":"sha512-WniqkAZTvJjGl1ooy1kunQYRWWXhgdZimSHi12UzrBbMQjc+RjsZeuQj99DhK4gqb0FKEbFBq0TrBCFgsAOQMw==","signatures":[{"sig":"MEQCIE3xgkRy0Xdxcr2l5O9mYq7ZOk9KtWMp2psiGa7bREB/AiBgDaLKMAVVwdkZdnVJjisjLdGm7iUDOHjNe1vHmBjWUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib","_from":"./","engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha -u tdd"},"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git@github.com:samuelerdtman/strict-transport-security.git","type":"git"},"_npmVersion":"1.2.32","description":"Middleware to add Strict-Transport-Security header.","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.13.x"}},"0.2.1":{"name":"strict-transport-security","version":"0.2.1","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"_id":"strict-transport-security@0.2.1","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"homepage":"https://github.com/samuelerdtman/strict-transport-security#readme","bugs":{"url":"https://github.com/samuelerdtman/strict-transport-security/issues"},"dist":{"shasum":"df97bbd38f7ee6b2c3502fabdf23317087c72503","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.2.1.tgz","integrity":"sha512-FyMvnFWrvhihVPN911Xpl42FYOkKBb3aU1968T554Ao3CcWm0fGc85rK9RsSYviIPztZ7IPxEUVsxL1h6cnXWA==","signatures":[{"sig":"MEUCIQDENry9d7ymr8shcKW2jaE6S6ODCFAqwFy5sZED1V20UgIgFzqbmSKXR8sQSX3Ax/pF4C94G26ZSKB4J/KQloI53gg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"df97bbd38f7ee6b2c3502fabdf23317087c72503","engines":{"node":">= 0.4.0"},"gitHead":"a83be1e6073b2c21eeaaf5d60f98670306a2c4eb","scripts":{"dev":"npm-run-all -p --silent watch live","live":"live-server -q --port=4003 --ignorePattern='(js|css|png)$' coverage","test":"ava test","clean":"rm -rf coverage/ .nyc_output/","watch":"watch 'npm run coveragehtml' test lib","pretest":"semistandard","coverage":"nyc npm test","coveralls":"nyc report --reporter=text-lcov | coveralls","coveragehtml":"nyc report -r html","precoveragehtml":"npm run coverage"},"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git+ssh://git@github.com/samuelerdtman/strict-transport-security.git","type":"git"},"_npmVersion":"3.10.9","description":"Middleware to add Strict-Transport-Security header.","directories":{},"_nodeVersion":"7.2.0","dependencies":{},"devDependencies":{"ava":"*","nyc":"*","watch":"*","live-server":"*","npm-run-all":"*","semistandard":"*"},"_npmOperationalInternal":{"tmp":"tmp/strict-transport-security-0.2.1.tgz_1511474703883_0.9569370250683278","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"strict-transport-security","version":"0.2.2","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"_id":"strict-transport-security@0.2.2","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"homepage":"https://github.com/samuelerdtman/strict-transport-security#readme","bugs":{"url":"https://github.com/samuelerdtman/strict-transport-security/issues"},"dist":{"shasum":"ab1d548915a843d4314f7a9b1019462efd645bd0","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.2.2.tgz","fileCount":10,"integrity":"sha512-+VGEjZbFYVBfe+f2Tk0x3h5wOWqPOJ0TNzMm8MdFdGT+pyC/yViwfXnPslV0OxhVy7CZ8jm917Ya7uTCnAa+HQ==","signatures":[{"sig":"MEUCIB1psJ+dqDjugIze8lwn/yduv0ouraXhM5C7V++29dpCAiEA/eU5LSYzW0RWs3GVBxFFyB5P5bIeoG0URZx1ibWvR1M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM9XjCRA9TVsSAnZWagAA4bgP/jE6Qp04H4DJ12ah5K2c\ng+opxbDDLnQ0bXLGTb30C3P4WNxabQFFKVjIyhm7k+3P3wJ/0o/ad347uzKt\nvPnp011a/rkJM55OIE338HIi0w6Jot+utvuFYo7drYaRoz/Txbss/3f99DhZ\nzeTdjLXnIRZn30E/PFCvSVWtPycCulVx8UJjHaVz4l8L9P5gBdGBNNyDj0ZN\nzs880I7w9UbdBPtbnvYhs4wm+IEx6lQdRuYol2iL7sr2ZyVvlWC/S0xErUBW\nw3BtwxrqO5Jz3uiFAMAzCjhrgEZFPtJz8p6h1r3QfDEn+Oco+QWNy6yIbhM6\nOWrEn7bJWRyAetNxzRjE9Ne52mnZ7f0gAJ/glev5D8rS+p5+osmVxxQyNcCB\nf6nBI0H3GY7vq+QFD3npKdZwYQuhOgD4/9O3eV94SeKknOIppPXfyRAP1F2Z\nTVR8tnGW6/TYHIjbSFDQhXAIxXzUh1EChgIrqudjafhrEprpijllDyyGD5o3\nJENmtglMtmFmbsthu2g85l185JwMP6ztqMlb5xcm0/brLs68eFNX/7Z4e0RS\nf3RcvHMKMtrLdG323odzUArmExV0S5KQWoy/K6b9fejl9PXOp0q1ctz+6fEt\nExlxJAdIA3YVExqDPOx6BBNIzCSskk/hamm+QORBeGf1tYlMb6hYitD9EXdc\n3wUJ\r\n=7o7W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","engines":{"node":">= 0.4.0"},"gitHead":"056fc812fac4f17a1ae1470e0d03e57cc480333d","scripts":{"dev":"npm-run-all -p --silent watch live","live":"live-server -q --port=4003 --ignorePattern='(js|css|png)$' coverage","test":"ava test/*.js","clean":"rm -rf coverage/ .nyc_output/","watch":"watch 'npm run coveragehtml' test lib","pretest":"semistandard --fix","coverage":"nyc npm test","coveralls":"nyc report --reporter=text-lcov | coveralls","coveragehtml":"nyc report -r html","precoveragehtml":"npm run coverage"},"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git+ssh://git@github.com/samuelerdtman/strict-transport-security.git","type":"git"},"_npmVersion":"6.14.4","description":"Middleware to add Strict-Transport-Security header.","directories":{},"_nodeVersion":"12.16.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ava":"*","nyc":"*","watch":"*","live-server":"*","npm-run-all":"*","semistandard":"*"},"_npmOperationalInternal":{"tmp":"tmp/strict-transport-security_0.2.2_1597232611290_0.934056000256102","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"strict-transport-security","version":"0.3.0","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"_id":"strict-transport-security@0.3.0","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"homepage":"https://github.com/samuelerdtman/strict-transport-security#readme","bugs":{"url":"https://github.com/samuelerdtman/strict-transport-security/issues"},"dist":{"shasum":"8d8665de1553079a63b09a86d55a1a01d83c93e3","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.3.0.tgz","fileCount":6,"integrity":"sha512-kFE7mnIaiHGmPTdfeME+vEW2WDAPu0H7CNSbA+WuCMXRiadAfOOX/SfOj9NV/2ANc2z5JHMG9lnSvSaj3I+9sQ==","signatures":[{"sig":"MEUCIQCnYpMaO6zHTjGzTC8cJgmYaCi0ncbf0dPk20jsZAoKXAIgWQqjafC8d4MeyB9EvfrLcRenF9tEniMLtkf0iDEDg2k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpHRBCRA9TVsSAnZWagAAQ1cP/jXkaI5pz/R4D9C0zOi4\n0kRIABZfy6s0rpUzpLtHTzNreoJBA7OA6/uAx1i6189SxAVyNYWfiwe3m1pt\nO4dAmkAv9dYq64c5pGKQlc6RA0l2pZ8S23VsSSZE69hcYRygdVifdFKuJ5fz\n3oHN1i8CfR5VT0bAWjXFzHicFACLSRiHbjvJvqqcJU3rH03Zh4t3nk1lguPG\nuxDmAQGHCcpy/hrtRNWxKNUwT2eotqGv6IlC4ExETk3/EO3XS00salW6ujFe\nxRVVww7SnYMlRcRUNeQrSQGzjCsZ2Lt4YW4ek65D95jJBsQtefYDkqFePJVz\nA5/cKS6Wbpd/IFnWee1whfJ/dCizoj3ArYxufQoxgtdoUvJIi407DFGOQ5nq\nZ+IRGylf1vsG4b24GPk85jOaQ+FA0laW0IGCzJhEQ3xXOqnEltpFcCtD/qkQ\n1CkcRlrHzS59aZO0nmlwgj4iwXmsnr/KRQhP2XEHfPYGtnADJAwUnpDkWF5x\nf7seSjUk6iGiqyqwTLhmkxj/M8MaYXjOtBLXutDQlS1ymCAnbC3DqbeQsE7q\nF35PTO4LtvR13C/BTSa8BUCMlADdqENL4F16BkZhUw6WknWV1pHB/sfiFbEW\nv2obOgqsM019OHhvMuxAkUWt0XohdWSGs7v1XF8XtduVKxvNVbbWH2hm17Qc\nCIbg\r\n=bWvE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","engines":{"node":">= 0.4.0"},"gitHead":"d41788245cb77d91846116517d623233ca5954e8","scripts":{"dev":"npm-run-all -p --silent watch live","live":"live-server -q --port=4003 --ignorePattern='(js|css|png)$' coverage","test":"ava test/*.js","clean":"rm -rf coverage/ .nyc_output/","watch":"watch 'npm run coveragehtml' test lib","pretest":"semistandard --fix","coverage":"nyc npm test","coveralls":"nyc report --reporter=text-lcov | coveralls","coveragehtml":"nyc report -r html","precoveragehtml":"npm run coverage"},"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git+ssh://git@github.com/samuelerdtman/strict-transport-security.git","type":"git"},"_npmVersion":"6.14.4","description":"Middleware to add Strict-Transport-Security header.","directories":{},"_nodeVersion":"12.16.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ava":"*","nyc":"*","watch":"*","live-server":"*","npm-run-all":"*","semistandard":"*"},"_npmOperationalInternal":{"tmp":"tmp/strict-transport-security_0.3.0_1604613184714_0.082485331922312","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"strict-transport-security","version":"0.4.0","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts","hsts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"license":"MIT","_id":"strict-transport-security@0.4.0","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"homepage":"https://github.com/erdtman/strict-transport-security#readme","bugs":{"url":"https://github.com/erdtman/strict-transport-security/issues"},"dist":{"shasum":"b1343ff933f3c15438397f91e5dcb36261be3919","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.4.0.tgz","fileCount":4,"integrity":"sha512-WEqu3qwk8PFGmt0GTRUJve5FJ+HWu/NqnCwNtnPGlEImGUqVOG+PPUfJ3GqcwoFeSKBo2vBZ2GPfNTuZcHu5+w==","signatures":[{"sig":"MEUCIFVnFmo+BHu+DlCGtifTMX7iGCKioJut73D5XBofBzptAiEAswpjz+VoIvUQKYZXfnLSCzmVc/VgaANE1VX7ud5Q70c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/strict-transport-security@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10487},"main":"lib/index.js","engines":{"node":">=20.0.0"},"gitHead":"9737d2f326902d1948d22f21c78736765bc50e2b","scripts":{"test":"node --test","coverage":"node --test --experimental-test-coverage --test-coverage-exclude=\"test/**\"","coverage:check":"npm run coverage -- --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"trustedPublisher":{"id":"github","oidcConfigId":"316f5a66-adf3-400b-9a18-9eefad687d0e"}},"repository":{"url":"git+https://github.com/erdtman/strict-transport-security.git","type":"git"},"_npmVersion":"12.2.0","description":"Middleware to add Strict-Transport-Security header.","directories":{},"_nodeVersion":"24.21.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/strict-transport-security_0.4.0_1791667343703_0.4892008435522013","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"strict-transport-security","version":"0.5.0","keywords":["express","connect","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts","hsts"],"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"license":"MIT","_id":"strict-transport-security@0.5.0","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"homepage":"https://github.com/erdtman/strict-transport-security#readme","bugs":{"url":"https://github.com/erdtman/strict-transport-security/issues"},"dist":{"shasum":"75d97f293a171d04dfea702f2f626ed4d46f73c1","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-0.5.0.tgz","fileCount":4,"integrity":"sha512-1EJWwaUj5/MomUUA9DdMlny6pOvoQLYtaxH8dr8ZpwRU3Pnezsy1gPyK1aNGgBdKp+zTBVL1NgvuKeYEoIjPlQ==","signatures":[{"sig":"MEYCIQDChF5En5ugJp35TApUyHnSNCzkiRUpPGdG3BO5CDMkVgIhALPc+DfknAmMCE5InaVO0o+VJrq16sxWCspZKVwXY4lH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/strict-transport-security@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14341},"main":"lib/index.js","engines":{"node":">=20.0.0"},"gitHead":"07fa6570d2a8c93ad0cc97ba8ecdf2b533c0a0c6","scripts":{"test":"node --test","coverage":"node --test --experimental-test-coverage --test-coverage-exclude=\"test/**\"","test:watch":"node --test --watch","coverage:check":"npm run coverage -- --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"trustedPublisher":{"id":"github","oidcConfigId":"316f5a66-adf3-400b-9a18-9eefad687d0e"}},"repository":{"url":"git+https://github.com/erdtman/strict-transport-security.git","type":"git"},"_npmVersion":"12.2.0","description":"Middleware to add Strict-Transport-Security header.","directories":{},"_nodeVersion":"24.21.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/strict-transport-security_0.5.0_1792012792738_0.17554464655595758","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"_id":"strict-transport-security@1.0.0","bugs":{"url":"https://github.com/erdtman/strict-transport-security/issues"},"dist":{"shasum":"7121e81ee6c8aa11b0736c60477e27a45d6920ed","tarball":"https://registry.npmjs.org/strict-transport-security/-/strict-transport-security-1.0.0.tgz","integrity":"sha512-nZaFpMHmWr/DtIslcLO+Pu/w1J7OZyzaQsVbSIULOD4c87ffByXTwAqV9GBZsKrpEQhNM9iiPK4EkbcdC6Auhw==","fileCount":4,"unpackedSize":27927,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/strict-transport-security@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBb7pBb61+oe2QSyb8cGcTLMVTAvRPmMhvnv1SMk2FBaAiEA9HlMvm9KJ3hq7fd974HSce/w7+TIhBsjPO1mG3/BWdA="}]},"main":"lib/index.js","name":"strict-transport-security","author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"engines":{"node":">=20.0.0"},"gitHead":"e1d7b3b0d7315c9085aa66b8fbf454c400368bc3","license":"MIT","scripts":{"test":"node --test","coverage":"node --test --experimental-test-coverage --test-coverage-exclude=\"test/**\"","test:watch":"node --test --watch","coverage:check":"npm run coverage -- --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100","test:frameworks":"npm install --no-save --no-package-lock express fastify koa @hapi/hapi hono && node --test test/frameworks.test.js"},"version":"1.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"316f5a66-adf3-400b-9a18-9eefad687d0e"},"approver":{"name":"samuelerdtman","email":"samuel@erdtman.se"}},"homepage":"https://github.com/erdtman/strict-transport-security#readme","keywords":["express","connect","fastify","koa","hapi","hono","middleware","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts","hsts"],"repository":{"url":"git+https://github.com/erdtman/strict-transport-security.git","type":"git"},"_npmVersion":"12.2.1","description":"Middleware to add a Strict-Transport-Security header, on Express, Connect, Fastify, Koa, Hono, Hapi, or anything that can set a header.","directories":{},"maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"_nodeVersion":"24.22.1","dependencies":{},"publishConfig":{"access":"public"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strict-transport-security_1.0.0_1793224079161_0.4602465549003639"},"_hasShrinkwrap":false}},"time":{"created":"2014-01-19T03:53:23.397Z","modified":"2026-10-28T21:47:59.535Z","0.1.0":"2014-01-19T03:53:25.624Z","0.2.0":"2014-01-20T10:57:25.064Z","0.2.1":"2017-11-23T22:05:03.953Z","0.2.2":"2020-08-12T11:43:31.458Z","0.3.0":"2020-11-05T21:53:04.889Z","0.4.0":"2026-10-10T21:22:23.787Z","0.5.0":"2026-10-14T21:19:52.813Z","1.0.0":"2026-10-28T21:47:59.238Z"},"bugs":{"url":"https://github.com/erdtman/strict-transport-security/issues"},"author":{"name":"Samuel Erdtman","email":"samuel@erdtman.se"},"license":"MIT","homepage":"https://github.com/erdtman/strict-transport-security#readme","keywords":["express","connect","fastify","koa","hapi","hono","middleware","strict-transport-security","Strict Transport Security","security","SSL","TLS","HTTPS","sts","hsts"],"repository":{"url":"git+https://github.com/erdtman/strict-transport-security.git","type":"git"},"description":"Middleware to add a Strict-Transport-Security header, on Express, Connect, Fastify, Koa, Hono, Hapi, or anything that can set a header.","maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"readme":"[![CI](https://github.com/erdtman/strict-transport-security/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/erdtman/strict-transport-security/actions/workflows/ci.yml)\n\n# strict-transport-security\n\nAdds a Strict-Transport-Security header according to [RFC6797](http://tools.ietf.org/html/rfc6797),\non Express, Connect, Fastify, Koa, Hono, Hapi, or anything that can set a header.\n\nZero dependencies. Requires Node.js 20 or later.\n\n## Install\n```\n$ npm install strict-transport-security --save\n```\n\n## Usage\n```js\nconst sts = require('strict-transport-security');\nconst express = require('express');\nconst app = express();\n\n// HSTS is a per-host policy: a browser keeps one entry per host name, so one\n// policy on every response is the whole of it. See RFC 6797 section 5.3.\napp.use(sts.getSTS({ 'max-age': { days: 30 } }));\n\napp.get('/', (req, res) => {\n  res.send('Using the strict transport security policy!');\n});\n\napp.listen(3000, () => {\n  console.log('Example app listening on port 3000!');\n});\n```\n\n## One policy per host\n\nHSTS is not a per-path policy, which is worth knowing before mounting it like\none. A browser stores and indexes HSTS policies \"based strictly upon the domain\nnames of the issuing HSTS Hosts\" (RFC 6797\n[section 5.3](https://tools.ietf.org/html/rfc6797#section-5.3)) and updates\nthat single entry whenever a response carries a `max-age` or\n`includeSubDomains` differing from the one it holds\n([section 8.1](https://tools.ietf.org/html/rfc6797#section-8.1)). What it keeps\nis the host name, an expiry and the `includeSubDomains` flag -- no path, and\nnot even a port, since the policy \"applies to all ports on a Known HSTS Host\"\n(appendix B).\n\nSo two policies on two paths of one host are not two policies. They are one\nentry, rewritten by whichever response the visitor received last: a shorter\n`max-age` on a seldom-visited path quietly shortens the protection for the\nwhole host, and an `includeSubDomains` on one path asserts it for all of them.\nSend one policy on every response, which is also the \"constant value into the\nfuture\" deployment that\n[section 11.2](https://tools.ietf.org/html/rfc6797#section-11.2) describes.\n\nMounting a factory on part of an application is still worth doing where that\npart answers for a different host name -- a vhost, or a sub-app mounted under\nits own domain -- because that is a different entry in the browser's store.\nWithin one host, mount it once.\n\n## Frameworks\n\nA policy compiles to exactly one header, so fitting a framework is only a matter\nof knowing how it sets one -- and, for [`secureOnly`](#conformance), how it\nreports the scheme a request arrived over. Every factory below takes the same\n[options](#options) and validates them once, when it is called, so a bad\nconfiguration fails at startup rather than on every request.\n\n| Framework | Factory | Mounted as |\n| --- | --- | --- |\n| Express, Connect, restify, NestJS on Express | `getSTS` | middleware, `(req, res, next)` |\n| Fastify | `getFastifySTS` | an `onRequest` hook |\n| Koa | `getKoaSTS` | middleware, `(ctx, next)` |\n| Hono | `getHonoSTS` | middleware, `(c, next)` |\n| Hapi | `getHapiSTS` | an `onPreResponse` extension |\n| Next.js middleware, h3/Nitro, Workers, Deno, Bun, Elysia | `getHeadersSTS` | applied to a Fetch `Headers` |\n| anything else | `getSTSHeader` | a `{ name, value, secureOnly }` triple you set yourself |\n\nRunnable versions of each of these are in [`examples/`](examples).\n\n### Fastify\n\n```js\nconst sts = require('strict-transport-security');\nconst fastify = require('fastify')();\n\n// One hook on the instance covers every response, including the 404s and\n// errors fastify serves itself.\nfastify.addHook('onRequest', sts.getFastifySTS({ 'max-age': { days: 30 } }));\n\nfastify.get('/', async () => 'ok');\n```\n\n### Koa\n\n```js\nconst sts = require('strict-transport-security');\nconst Koa = require('koa');\nconst app = new Koa();\n\n// Outermost, so it covers whatever the rest of the stack answers with.\napp.use(sts.getKoaSTS({ 'max-age': { days: 30 } }));\n```\n\n### Hono\n\n```js\nconst sts = require('strict-transport-security');\nconst { Hono } = require('hono');\nconst app = new Hono();\n\napp.use('*', sts.getHonoSTS({ 'max-age': { days: 30 } }));\napp.get('/', (c) => c.text('ok'));\n```\n\nThe header is set before `next()`, not after, because Hono's response phase\nunwinds outermost-last: set afterwards, an app-wide policy would overwrite one\nmounted further in, the opposite of how every other framework here behaves.\n\n### Hapi\n\n```js\nconst sts = require('strict-transport-security');\nconst Hapi = require('@hapi/hapi');\nconst server = Hapi.server({ port: 3000 });\n\nserver.ext('onPreResponse', sts.getHapiSTS({ 'max-age': { days: 30 } }));\n\nserver.route({ method: 'GET', path: '/', handler: () => 'ok' });\n```\n\n`onPreResponse` is used rather than an earlier extension point because it is the\none that also covers the responses hapi generates itself, including Boom errors.\n\n### Fetch `Headers`\n\nAnywhere responses carry a standard `Headers` -- Next.js middleware, h3 and\nNitro, Cloudflare Workers, Deno, Bun, Elysia:\n\n```js\nimport sts from 'strict-transport-security';\nimport { NextResponse } from 'next/server';\n\nconst applySTS = sts.getHeadersSTS({ 'max-age': { days: 30 }, includeSubDomains: true });\n\nexport function middleware (request) {\n  const response = NextResponse.next();\n  applySTS(response.headers, request);\n  return response;\n}\n```\n\nThe second argument is the request the headers answer. It is read only under\n`secureOnly`, where it supplies the scheme, and may be a Fetch `Request`, a\n`URL` or a URL string; `secureOnly` with no request at all throws rather than\nguess. Without `secureOnly` it can be left out.\n\n### Anything else\n\n`getSTSHeader` returns the frozen header the factories above are built on, so a\nframework with none of these shapes is still a few lines:\n\n```js\nconst sts = require('strict-transport-security');\n\nconst { name, value, secureOnly } = sts.getSTSHeader({ 'max-age': { days: 30 } });\n// { name: 'Strict-Transport-Security', value: 'max-age=2592000', secureOnly: false }\n```\n\n`secureOnly` is not part of the header: it is the option, telling your own\nadapter whether this header may be sent over a non-secure connection.\n\n### Responses the framework generates\n\nA 404 or a 500 served by the framework itself is a response like any other, and\na policy that only covers your handlers is a policy with holes in it. All six\nfactories above cover those too, which `test/frameworks.test.js` pins against\neach real framework.\n\n## Options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `max-age` | number, or object of time units | 30 days | Policy lifetime. A number is a count of seconds; an object may combine `seconds`, `minutes`, `hours` and `days`. The total must be a non-negative integer no greater than `Number.MAX_SAFE_INTEGER`. |\n| `includeSubDomains` | boolean | `false` | Adds the `includeSubDomains` directive. |\n| `preload` | boolean | `false` | Adds the `preload` directive. |\n| `secureOnly` | boolean | `false` | Sends the header only over a secure connection, as RFC 6797 requires. See [Conformance](#conformance). |\n\n```js\nsts.getSTS({ 'max-age': 86400 });\n// Strict-Transport-Security: max-age=86400\n\nsts.getSTS({ 'max-age': { hours: 12, minutes: 30 } });\n// Strict-Transport-Security: max-age=45000\n\nsts.getSTS({ 'max-age': { days: 365 }, includeSubDomains: true, preload: true });\n// Strict-Transport-Security: max-age=31536000; includeSubDomains; preload\n```\n\nNote that submitting a domain to the [HSTS preload list](https://hstspreload.org/) requires\na `max-age` of at least one year together with `includeSubDomains`; this module adds the\n`preload` directive you ask for without checking those conditions.\n\n### Invalid options\n\nEvery factory validates its options when it is called, so a bad configuration\nfails at startup rather than silently emitting a policy you did not intend:\n\n```js\nsts.getSTS({ 'max-age': {} });           // TypeError: no recognized time units\nsts.getSTS({ 'max-age': '600' });        // TypeError: must be a number or an object of time units\nsts.getSTS({ 'max-age': -1 });           // RangeError: must be a non-negative integer\nsts.getSTS({ 'max-age': 1.5 });          // RangeError: must be a non-negative integer\nsts.getSTS({ 'max-age': 1e21 });         // RangeError: must be a non-negative integer no greater than 9007199254740991\nsts.getSTS({ maxAge: 600 });             // TypeError: unknown option 'maxAge'\nsts.getSTS({ includeSubdomains: true }); // TypeError: unknown option 'includeSubdomains'\nsts.getSTS({ 'max-age': { week: 2 } });  // TypeError: unknown time unit 'week'\n```\n\nUnknown options and unknown time units are rejected rather than ignored: a typo such as\n`includeSubdomains` or `maxAge` would otherwise leave you with a quietly weaker policy\nthan the one you wrote. Earlier versions accepted them silently.\n\nAn upper bound of `Number.MAX_SAFE_INTEGER` comes from the header grammar. RFC 6797\n[section 6.1.1](https://tools.ietf.org/html/rfc6797#section-6.1.1) defines `max-age` as\n`1*DIGIT`, and larger numbers either stringify in exponential notation, which no browser\nparses, or have already lost precision.\n\n`max-age: 0` is accepted -- RFC 6797 defines it as the signal telling a browser to delete a\nstored policy.\n\n## Conformance\n\nRFC 6797 [section 7.2](https://tools.ietf.org/html/rfc6797#section-7.2) says a host must not\nsend the `Strict-Transport-Security` header over a non-secure transport. By default this\nmiddleware sets the header on every response, which is convenient when TLS is terminated by a\nproxy in front of the app and harmless in practice because browsers ignore the header when it\narrives over plain HTTP.\n\nTo get the conformant behaviour, set `secureOnly`:\n\n```js\napp.use(sts.getSTS({ 'max-age': { days: 30 }, secureOnly: true }));\n```\n\nEach factory asks its own framework what scheme the request arrived over, so\n`secureOnly` behaves the way the rest of that application does:\n\n| Factory | Secure when |\n| --- | --- |\n| `getSTS` | `req.secure`, which behind a proxy needs [`app.set('trust proxy', ...)`](https://expressjs.com/en/guide/behind-proxies.html); otherwise an encrypted socket |\n| `getFastifySTS` | `request.protocol` is `https`, which honours `trustProxy`; otherwise an encrypted socket on `request.raw` |\n| `getKoaSTS` | `ctx.secure`, which honours `app.proxy`; otherwise `ctx.protocol`, or an encrypted socket on `ctx.req` |\n| `getHonoSTS` | the request URL's scheme is `https:` |\n| `getHapiSTS` | `request.url.protocol` is `https:`; otherwise an encrypted socket on `request.raw.req` |\n| `getHeadersSTS` | the scheme of the request passed as the second argument is `https:` |\n\nHono and the Fetch runtimes have no trusted-proxy setting, so behind a\nTLS-terminating proxy their request URL stays `http:` and `secureOnly`\nsuppresses the header. Either leave `secureOnly` off there -- browsers ignore\nthe header over plain HTTP anyway -- or pass `getHeadersSTS` the URL you have\nresolved yourself.\n\n## Contributing\n\nDevelopment setup, how the test suite is layered, and the release process are\nin [CONTRIBUTING.md](CONTRIBUTING.md) and [RELEASING.md](RELEASING.md).\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}