helmetjs / helmet

Help secure Express apps with various HTTP headers

Home Page:https://helmetjs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use ContentSecurityPolicyOptions because it is not exported

serenaqchen opened this issue · comments

commented

Previously I was able to gain access to ContentSecurityPolicyOptions through this:

import { ContentSecurityPolicyOptions } from 'helmet/dist/types/middlewares/content-security-policy';

Seem like ContentSecurityPolicyOptions is not exported so I can no longer access it.

Sorry about this. That import was never supported, but does this work for you?

type ContentSecurityPolicyOptions = Parameters<typeof helmet.contentSecurityPolicy>[0];
commented

Yes, it does! Thank you!