index.mjs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. const dangerouslyDisableDefaultSrc = Symbol("dangerouslyDisableDefaultSrc")
  2. const SHOULD_BE_QUOTED = new Set(["none", "self", "strict-dynamic", "report-sample", "inline-speculation-rules", "unsafe-inline", "unsafe-eval", "unsafe-hashes", "wasm-unsafe-eval"])
  3. const getDefaultDirectives = () => ({
  4. "default-src": ["'self'"],
  5. "base-uri": ["'self'"],
  6. "font-src": ["'self'", "https:", "data:"],
  7. "form-action": ["'self'"],
  8. "frame-ancestors": ["'self'"],
  9. "img-src": ["'self'", "data:"],
  10. "object-src": ["'none'"],
  11. "script-src": ["'self'"],
  12. "script-src-attr": ["'none'"],
  13. "style-src": ["'self'", "https:", "'unsafe-inline'"],
  14. "upgrade-insecure-requests": []
  15. })
  16. const dashify = str => str.replace(/[A-Z]/g, capitalLetter => "-" + capitalLetter.toLowerCase())
  17. const assertDirectiveValueIsValid = (directiveName, directiveValue) => {
  18. if (/;|,/.test(directiveValue)) {
  19. throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`)
  20. }
  21. }
  22. const assertDirectiveValueEntryIsValid = (directiveName, directiveValueEntry) => {
  23. if (SHOULD_BE_QUOTED.has(directiveValueEntry) || directiveValueEntry.startsWith("nonce-") || directiveValueEntry.startsWith("sha256-") || directiveValueEntry.startsWith("sha384-") || directiveValueEntry.startsWith("sha512-")) {
  24. throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}. ${JSON.stringify(directiveValueEntry)} should be quoted`)
  25. }
  26. }
  27. function normalizeDirectives(options) {
  28. const defaultDirectives = getDefaultDirectives()
  29. const {useDefaults = true, directives: rawDirectives = defaultDirectives} = options
  30. const result = new Map()
  31. const directiveNamesSeen = new Set()
  32. const directivesExplicitlyDisabled = new Set()
  33. for (const rawDirectiveName in rawDirectives) {
  34. if (!Object.hasOwn(rawDirectives, rawDirectiveName)) {
  35. continue
  36. }
  37. if (rawDirectiveName.length === 0 || /[^a-zA-Z0-9-]/.test(rawDirectiveName)) {
  38. throw new Error(`Content-Security-Policy received an invalid directive name ${JSON.stringify(rawDirectiveName)}`)
  39. }
  40. const directiveName = dashify(rawDirectiveName)
  41. if (directiveNamesSeen.has(directiveName)) {
  42. throw new Error(`Content-Security-Policy received a duplicate directive ${JSON.stringify(directiveName)}`)
  43. }
  44. directiveNamesSeen.add(directiveName)
  45. const rawDirectiveValue = rawDirectives[rawDirectiveName]
  46. let directiveValue
  47. if (rawDirectiveValue === null) {
  48. if (directiveName === "default-src") {
  49. throw new Error("Content-Security-Policy needs a default-src but it was set to `null`. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.")
  50. }
  51. directivesExplicitlyDisabled.add(directiveName)
  52. continue
  53. } else if (typeof rawDirectiveValue === "string") {
  54. directiveValue = [rawDirectiveValue]
  55. } else if (!rawDirectiveValue) {
  56. throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`)
  57. } else if (rawDirectiveValue === dangerouslyDisableDefaultSrc) {
  58. if (directiveName === "default-src") {
  59. directivesExplicitlyDisabled.add("default-src")
  60. continue
  61. } else {
  62. throw new Error(`Content-Security-Policy: tried to disable ${JSON.stringify(directiveName)} as if it were default-src; simply omit the key`)
  63. }
  64. } else {
  65. directiveValue = rawDirectiveValue
  66. }
  67. for (const element of directiveValue) {
  68. if (typeof element !== "string") continue
  69. assertDirectiveValueIsValid(directiveName, element)
  70. assertDirectiveValueEntryIsValid(directiveName, element)
  71. }
  72. result.set(directiveName, directiveValue)
  73. }
  74. if (useDefaults) {
  75. Object.entries(defaultDirectives).forEach(([defaultDirectiveName, defaultDirectiveValue]) => {
  76. if (!result.has(defaultDirectiveName) && !directivesExplicitlyDisabled.has(defaultDirectiveName)) {
  77. result.set(defaultDirectiveName, defaultDirectiveValue)
  78. }
  79. })
  80. }
  81. if (!result.size) {
  82. throw new Error("Content-Security-Policy has no directives. Either set some or disable the header")
  83. }
  84. if (!result.has("default-src") && !directivesExplicitlyDisabled.has("default-src")) {
  85. throw new Error("Content-Security-Policy needs a default-src but none was provided. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.")
  86. }
  87. return result
  88. }
  89. function getHeaderValue(req, res, normalizedDirectives) {
  90. const result = []
  91. for (const [directiveName, rawDirectiveValue] of normalizedDirectives) {
  92. let directiveValue = ""
  93. for (const element of rawDirectiveValue) {
  94. if (typeof element === "function") {
  95. const newElement = element(req, res)
  96. assertDirectiveValueEntryIsValid(directiveName, newElement)
  97. directiveValue += " " + newElement
  98. } else {
  99. directiveValue += " " + element
  100. }
  101. }
  102. if (directiveValue) {
  103. assertDirectiveValueIsValid(directiveName, directiveValue)
  104. result.push(`${directiveName}${directiveValue}`)
  105. } else {
  106. result.push(directiveName)
  107. }
  108. }
  109. return result.join(";")
  110. }
  111. const contentSecurityPolicy = function contentSecurityPolicy(options = {}) {
  112. const headerName = options.reportOnly ? "Content-Security-Policy-Report-Only" : "Content-Security-Policy"
  113. const normalizedDirectives = normalizeDirectives(options)
  114. return function contentSecurityPolicyMiddleware(req, res, next) {
  115. const result = getHeaderValue(req, res, normalizedDirectives)
  116. if (result instanceof Error) {
  117. next(result)
  118. } else {
  119. res.setHeader(headerName, result)
  120. next()
  121. }
  122. }
  123. }
  124. contentSecurityPolicy.getDefaultDirectives = getDefaultDirectives
  125. contentSecurityPolicy.dangerouslyDisableDefaultSrc = dangerouslyDisableDefaultSrc
  126. const ALLOWED_POLICIES$2 = new Set(["require-corp", "credentialless", "unsafe-none"])
  127. function getHeaderValueFromOptions$6({policy = "require-corp"}) {
  128. if (ALLOWED_POLICIES$2.has(policy)) {
  129. return policy
  130. } else {
  131. throw new Error(`Cross-Origin-Embedder-Policy does not support the ${JSON.stringify(policy)} policy`)
  132. }
  133. }
  134. function crossOriginEmbedderPolicy(options = {}) {
  135. const headerValue = getHeaderValueFromOptions$6(options)
  136. return function crossOriginEmbedderPolicyMiddleware(_req, res, next) {
  137. res.setHeader("Cross-Origin-Embedder-Policy", headerValue)
  138. next()
  139. }
  140. }
  141. const ALLOWED_POLICIES$1 = new Set(["same-origin", "same-origin-allow-popups", "unsafe-none"])
  142. function getHeaderValueFromOptions$5({policy = "same-origin"}) {
  143. if (ALLOWED_POLICIES$1.has(policy)) {
  144. return policy
  145. } else {
  146. throw new Error(`Cross-Origin-Opener-Policy does not support the ${JSON.stringify(policy)} policy`)
  147. }
  148. }
  149. function crossOriginOpenerPolicy(options = {}) {
  150. const headerValue = getHeaderValueFromOptions$5(options)
  151. return function crossOriginOpenerPolicyMiddleware(_req, res, next) {
  152. res.setHeader("Cross-Origin-Opener-Policy", headerValue)
  153. next()
  154. }
  155. }
  156. const ALLOWED_POLICIES = new Set(["same-origin", "same-site", "cross-origin"])
  157. function getHeaderValueFromOptions$4({policy = "same-origin"}) {
  158. if (ALLOWED_POLICIES.has(policy)) {
  159. return policy
  160. } else {
  161. throw new Error(`Cross-Origin-Resource-Policy does not support the ${JSON.stringify(policy)} policy`)
  162. }
  163. }
  164. function crossOriginResourcePolicy(options = {}) {
  165. const headerValue = getHeaderValueFromOptions$4(options)
  166. return function crossOriginResourcePolicyMiddleware(_req, res, next) {
  167. res.setHeader("Cross-Origin-Resource-Policy", headerValue)
  168. next()
  169. }
  170. }
  171. function originAgentCluster() {
  172. return function originAgentClusterMiddleware(_req, res, next) {
  173. res.setHeader("Origin-Agent-Cluster", "?1")
  174. next()
  175. }
  176. }
  177. const ALLOWED_TOKENS = new Set(["no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url", ""])
  178. function getHeaderValueFromOptions$3({policy = ["no-referrer"]}) {
  179. const tokens = typeof policy === "string" ? [policy] : policy
  180. if (tokens.length === 0) {
  181. throw new Error("Referrer-Policy received no policy tokens")
  182. }
  183. const tokensSeen = new Set()
  184. tokens.forEach(token => {
  185. if (!ALLOWED_TOKENS.has(token)) {
  186. throw new Error(`Referrer-Policy received an unexpected policy token ${JSON.stringify(token)}`)
  187. } else if (tokensSeen.has(token)) {
  188. throw new Error(`Referrer-Policy received a duplicate policy token ${JSON.stringify(token)}`)
  189. }
  190. tokensSeen.add(token)
  191. })
  192. return tokens.join(",")
  193. }
  194. function referrerPolicy(options = {}) {
  195. const headerValue = getHeaderValueFromOptions$3(options)
  196. return function referrerPolicyMiddleware(_req, res, next) {
  197. res.setHeader("Referrer-Policy", headerValue)
  198. next()
  199. }
  200. }
  201. const DEFAULT_MAX_AGE = 365 * 24 * 60 * 60
  202. function parseMaxAge(value = DEFAULT_MAX_AGE) {
  203. if (value >= 0 && Number.isFinite(value)) {
  204. return Math.floor(value)
  205. } else {
  206. throw new Error(`Strict-Transport-Security: ${JSON.stringify(value)} is not a valid value for maxAge. Please choose a positive integer.`)
  207. }
  208. }
  209. function getHeaderValueFromOptions$2(options) {
  210. if ("maxage" in options) {
  211. throw new Error("Strict-Transport-Security received an unsupported property, `maxage`. Did you mean to pass `maxAge`?")
  212. }
  213. if ("includeSubdomains" in options) {
  214. throw new Error('Strict-Transport-Security middleware should use `includeSubDomains` instead of `includeSubdomains`. (The correct one has an uppercase "D".)')
  215. }
  216. const directives = [`max-age=${parseMaxAge(options.maxAge)}`]
  217. if (options.includeSubDomains === undefined || options.includeSubDomains) {
  218. directives.push("includeSubDomains")
  219. }
  220. if (options.preload) {
  221. directives.push("preload")
  222. }
  223. return directives.join("; ")
  224. }
  225. function strictTransportSecurity(options = {}) {
  226. const headerValue = getHeaderValueFromOptions$2(options)
  227. return function strictTransportSecurityMiddleware(_req, res, next) {
  228. res.setHeader("Strict-Transport-Security", headerValue)
  229. next()
  230. }
  231. }
  232. function xContentTypeOptions() {
  233. return function xContentTypeOptionsMiddleware(_req, res, next) {
  234. res.setHeader("X-Content-Type-Options", "nosniff")
  235. next()
  236. }
  237. }
  238. function xDnsPrefetchControl(options = {}) {
  239. const headerValue = options.allow ? "on" : "off"
  240. return function xDnsPrefetchControlMiddleware(_req, res, next) {
  241. res.setHeader("X-DNS-Prefetch-Control", headerValue)
  242. next()
  243. }
  244. }
  245. function xDownloadOptions() {
  246. return function xDownloadOptionsMiddleware(_req, res, next) {
  247. res.setHeader("X-Download-Options", "noopen")
  248. next()
  249. }
  250. }
  251. function getHeaderValueFromOptions$1({action = "sameorigin"}) {
  252. const normalizedAction = typeof action === "string" ? action.toUpperCase() : action
  253. switch (normalizedAction) {
  254. case "SAME-ORIGIN":
  255. return "SAMEORIGIN"
  256. case "DENY":
  257. case "SAMEORIGIN":
  258. return normalizedAction
  259. default:
  260. throw new Error(`X-Frame-Options received an invalid action ${JSON.stringify(action)}`)
  261. }
  262. }
  263. function xFrameOptions(options = {}) {
  264. const headerValue = getHeaderValueFromOptions$1(options)
  265. return function xFrameOptionsMiddleware(_req, res, next) {
  266. res.setHeader("X-Frame-Options", headerValue)
  267. next()
  268. }
  269. }
  270. const ALLOWED_PERMITTED_POLICIES = new Set(["none", "master-only", "by-content-type", "all"])
  271. function getHeaderValueFromOptions({permittedPolicies = "none"}) {
  272. if (ALLOWED_PERMITTED_POLICIES.has(permittedPolicies)) {
  273. return permittedPolicies
  274. } else {
  275. throw new Error(`X-Permitted-Cross-Domain-Policies does not support ${JSON.stringify(permittedPolicies)}`)
  276. }
  277. }
  278. function xPermittedCrossDomainPolicies(options = {}) {
  279. const headerValue = getHeaderValueFromOptions(options)
  280. return function xPermittedCrossDomainPoliciesMiddleware(_req, res, next) {
  281. res.setHeader("X-Permitted-Cross-Domain-Policies", headerValue)
  282. next()
  283. }
  284. }
  285. function xPoweredBy() {
  286. return function xPoweredByMiddleware(_req, res, next) {
  287. res.removeHeader("X-Powered-By")
  288. next()
  289. }
  290. }
  291. function xXssProtection() {
  292. return function xXssProtectionMiddleware(_req, res, next) {
  293. res.setHeader("X-XSS-Protection", "0")
  294. next()
  295. }
  296. }
  297. function getMiddlewareFunctionsFromOptions(options) {
  298. const result = []
  299. switch (options.contentSecurityPolicy) {
  300. case undefined:
  301. case true:
  302. result.push(contentSecurityPolicy())
  303. break
  304. case false:
  305. break
  306. default:
  307. result.push(contentSecurityPolicy(options.contentSecurityPolicy))
  308. break
  309. }
  310. switch (options.crossOriginEmbedderPolicy) {
  311. case undefined:
  312. case false:
  313. break
  314. case true:
  315. result.push(crossOriginEmbedderPolicy())
  316. break
  317. default:
  318. result.push(crossOriginEmbedderPolicy(options.crossOriginEmbedderPolicy))
  319. break
  320. }
  321. switch (options.crossOriginOpenerPolicy) {
  322. case undefined:
  323. case true:
  324. result.push(crossOriginOpenerPolicy())
  325. break
  326. case false:
  327. break
  328. default:
  329. result.push(crossOriginOpenerPolicy(options.crossOriginOpenerPolicy))
  330. break
  331. }
  332. switch (options.crossOriginResourcePolicy) {
  333. case undefined:
  334. case true:
  335. result.push(crossOriginResourcePolicy())
  336. break
  337. case false:
  338. break
  339. default:
  340. result.push(crossOriginResourcePolicy(options.crossOriginResourcePolicy))
  341. break
  342. }
  343. switch (options.originAgentCluster) {
  344. case undefined:
  345. case true:
  346. result.push(originAgentCluster())
  347. break
  348. case false:
  349. break
  350. default:
  351. console.warn("Origin-Agent-Cluster does not take options. Remove the property to silence this warning.")
  352. result.push(originAgentCluster())
  353. break
  354. }
  355. switch (options.referrerPolicy) {
  356. case undefined:
  357. case true:
  358. result.push(referrerPolicy())
  359. break
  360. case false:
  361. break
  362. default:
  363. result.push(referrerPolicy(options.referrerPolicy))
  364. break
  365. }
  366. if ("strictTransportSecurity" in options && "hsts" in options) {
  367. throw new Error("Strict-Transport-Security option was specified twice. Remove `hsts` to silence this warning.")
  368. }
  369. const strictTransportSecurityOption = options.strictTransportSecurity ?? options.hsts
  370. switch (strictTransportSecurityOption) {
  371. case undefined:
  372. case true:
  373. result.push(strictTransportSecurity())
  374. break
  375. case false:
  376. break
  377. default:
  378. result.push(strictTransportSecurity(strictTransportSecurityOption))
  379. break
  380. }
  381. if ("xContentTypeOptions" in options && "noSniff" in options) {
  382. throw new Error("X-Content-Type-Options option was specified twice. Remove `noSniff` to silence this warning.")
  383. }
  384. const xContentTypeOptionsOption = options.xContentTypeOptions ?? options.noSniff
  385. switch (xContentTypeOptionsOption) {
  386. case undefined:
  387. case true:
  388. result.push(xContentTypeOptions())
  389. break
  390. case false:
  391. break
  392. default:
  393. console.warn("X-Content-Type-Options does not take options. Remove the property to silence this warning.")
  394. result.push(xContentTypeOptions())
  395. break
  396. }
  397. if ("xDnsPrefetchControl" in options && "dnsPrefetchControl" in options) {
  398. throw new Error("X-DNS-Prefetch-Control option was specified twice. Remove `dnsPrefetchControl` to silence this warning.")
  399. }
  400. const xDnsPrefetchControlOption = options.xDnsPrefetchControl ?? options.dnsPrefetchControl
  401. switch (xDnsPrefetchControlOption) {
  402. case undefined:
  403. case true:
  404. result.push(xDnsPrefetchControl())
  405. break
  406. case false:
  407. break
  408. default:
  409. result.push(xDnsPrefetchControl(xDnsPrefetchControlOption))
  410. break
  411. }
  412. if ("xDownloadOptions" in options && "ieNoOpen" in options) {
  413. throw new Error("X-Download-Options option was specified twice. Remove `ieNoOpen` to silence this warning.")
  414. }
  415. const xDownloadOptionsOption = options.xDownloadOptions ?? options.ieNoOpen
  416. switch (xDownloadOptionsOption) {
  417. case undefined:
  418. case true:
  419. result.push(xDownloadOptions())
  420. break
  421. case false:
  422. break
  423. default:
  424. console.warn("X-Download-Options does not take options. Remove the property to silence this warning.")
  425. result.push(xDownloadOptions())
  426. break
  427. }
  428. if ("xFrameOptions" in options && "frameguard" in options) {
  429. throw new Error("X-Frame-Options option was specified twice. Remove `frameguard` to silence this warning.")
  430. }
  431. const xFrameOptionsOption = options.xFrameOptions ?? options.frameguard
  432. switch (xFrameOptionsOption) {
  433. case undefined:
  434. case true:
  435. result.push(xFrameOptions())
  436. break
  437. case false:
  438. break
  439. default:
  440. result.push(xFrameOptions(xFrameOptionsOption))
  441. break
  442. }
  443. if ("xPermittedCrossDomainPolicies" in options && "permittedCrossDomainPolicies" in options) {
  444. throw new Error("X-Permitted-Cross-Domain-Policies option was specified twice. Remove `permittedCrossDomainPolicies` to silence this warning.")
  445. }
  446. const xPermittedCrossDomainPoliciesOption = options.xPermittedCrossDomainPolicies ?? options.permittedCrossDomainPolicies
  447. switch (xPermittedCrossDomainPoliciesOption) {
  448. case undefined:
  449. case true:
  450. result.push(xPermittedCrossDomainPolicies())
  451. break
  452. case false:
  453. break
  454. default:
  455. result.push(xPermittedCrossDomainPolicies(xPermittedCrossDomainPoliciesOption))
  456. break
  457. }
  458. if ("xPoweredBy" in options && "hidePoweredBy" in options) {
  459. throw new Error("X-Powered-By option was specified twice. Remove `hidePoweredBy` to silence this warning.")
  460. }
  461. const xPoweredByOption = options.xPoweredBy ?? options.hidePoweredBy
  462. switch (xPoweredByOption) {
  463. case undefined:
  464. case true:
  465. result.push(xPoweredBy())
  466. break
  467. case false:
  468. break
  469. default:
  470. console.warn("X-Powered-By does not take options. Remove the property to silence this warning.")
  471. result.push(xPoweredBy())
  472. break
  473. }
  474. if ("xXssProtection" in options && "xssFilter" in options) {
  475. throw new Error("X-XSS-Protection option was specified twice. Remove `xssFilter` to silence this warning.")
  476. }
  477. const xXssProtectionOption = options.xXssProtection ?? options.xssFilter
  478. switch (xXssProtectionOption) {
  479. case undefined:
  480. case true:
  481. result.push(xXssProtection())
  482. break
  483. case false:
  484. break
  485. default:
  486. console.warn("X-XSS-Protection does not take options. Remove the property to silence this warning.")
  487. result.push(xXssProtection())
  488. break
  489. }
  490. return result
  491. }
  492. const helmet = Object.assign(
  493. function helmet(options = {}) {
  494. // People should be able to pass an options object with no prototype,
  495. // so we want this optional chaining.
  496. // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
  497. if (options.constructor?.name === "IncomingMessage") {
  498. throw new Error("It appears you have done something like `app.use(helmet)`, but it should be `app.use(helmet())`.")
  499. }
  500. const middlewareFunctions = getMiddlewareFunctionsFromOptions(options)
  501. return function helmetMiddleware(req, res, next) {
  502. let middlewareIndex = 0
  503. ;(function internalNext(err) {
  504. if (err) {
  505. next(err)
  506. return
  507. }
  508. const middlewareFunction = middlewareFunctions[middlewareIndex]
  509. if (middlewareFunction) {
  510. middlewareIndex++
  511. middlewareFunction(req, res, internalNext)
  512. } else {
  513. next()
  514. }
  515. })()
  516. }
  517. },
  518. {
  519. contentSecurityPolicy,
  520. crossOriginEmbedderPolicy,
  521. crossOriginOpenerPolicy,
  522. crossOriginResourcePolicy,
  523. originAgentCluster,
  524. referrerPolicy,
  525. strictTransportSecurity,
  526. xContentTypeOptions,
  527. xDnsPrefetchControl,
  528. xDownloadOptions,
  529. xFrameOptions,
  530. xPermittedCrossDomainPolicies,
  531. xPoweredBy,
  532. xXssProtection,
  533. // Legacy aliases
  534. dnsPrefetchControl: xDnsPrefetchControl,
  535. xssFilter: xXssProtection,
  536. permittedCrossDomainPolicies: xPermittedCrossDomainPolicies,
  537. ieNoOpen: xDownloadOptions,
  538. noSniff: xContentTypeOptions,
  539. frameguard: xFrameOptions,
  540. hidePoweredBy: xPoweredBy,
  541. hsts: strictTransportSecurity
  542. }
  543. )
  544. export {contentSecurityPolicy, crossOriginEmbedderPolicy, crossOriginOpenerPolicy, crossOriginResourcePolicy, helmet as default, xDnsPrefetchControl as dnsPrefetchControl, xFrameOptions as frameguard, xPoweredBy as hidePoweredBy, strictTransportSecurity as hsts, xDownloadOptions as ieNoOpen, xContentTypeOptions as noSniff, originAgentCluster, xPermittedCrossDomainPolicies as permittedCrossDomainPolicies, referrerPolicy, strictTransportSecurity, xContentTypeOptions, xDnsPrefetchControl, xDownloadOptions, xFrameOptions, xPermittedCrossDomainPolicies, xPoweredBy, xXssProtection, xXssProtection as xssFilter}