Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface HelmetOptions - no longer public #251

Closed
ctomczyk opened this issue Aug 17, 2020 · 3 comments
Closed

interface HelmetOptions - no longer public #251

ctomczyk opened this issue Aug 17, 2020 · 3 comments

Comments

@ctomczyk
Copy link

Seems interface HelmetOptions is no longer public in helmet version 4.1.0.

Is that change intentional?

interface HelmetOptions {
    contentSecurityPolicy?: MiddlewareOption<ContentSecurityPolicyOptions>;
    dnsPrefetchControl?: MiddlewareOption<XDnsPrefetchControlOptions>;
    expectCt?: MiddlewareOption<ExpectCtOptions>;
    frameguard?: MiddlewareOption<XFrameOptionsOptions>;
    hidePoweredBy?: MiddlewareOption<never>;
    hsts?: MiddlewareOption<StrictTransportSecurityOptions>;
    ieNoOpen?: MiddlewareOption<never>;
    noSniff?: MiddlewareOption<never>;
    permittedCrossDomainPolicies?: MiddlewareOption<XPermittedCrossDomainPoliciesOptions>;
    referrerPolicy?: MiddlewareOption<ReferrerPolicyOptions>;
    xssFilter?: MiddlewareOption<never>;
}
@gperdomor
Copy link

I hope that change will be reverted

@EvanHahn
Copy link
Member

Unfortunately, reverting this is not possible, and its exposure was a bug in v4.0.0.

However, you can emulate it yourself (lifted from this comment):

import helmet = require('helmet');
const opts: Parameters<typeof helmet>[0] = {
  // strongly typed helmet options go here...
};
helmet(opts);

Hope this helps.

@gperdomor
Copy link

it works, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants