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

Support media-src #117

Closed
juergenzimmermann opened this issue Mar 26, 2016 · 8 comments
Closed

Support media-src #117

juergenzimmermann opened this issue Mar 26, 2016 · 8 comments

Comments

@juergenzimmermann
Copy link

Please see http://www.html5rocks.com/en/tutorials/security/content-security-policy/

@EvanHahn
Copy link
Member

I made a sample app that uses media-src and it appears to work for me. Does this not work for you?

app.use(helmet.csp({
  directives: {
    mediaSrc: ['media.example.com']
  }
}))

Are you using the latest version of helmet (and/or helmet-csp)?

@juergenzimmermann
Copy link
Author

Yes, I'm using the latest version of helmet - together with TypeScript. Due to TypeScript I'm also using helmet.d.ts and get this error message:
Type '{ defaultSrc: string[]; mediaSrc: string[]; }' is not assignable to type 'IHelmetCspDirectives'. Object literal may only specify known properties, and 'mediaSrc' does not exist in type 'IHelmetCspDirectives'.
The problem seems to be at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/helmet/helmet.d.ts#L11

@EvanHahn
Copy link
Member

This looks like a problem in DefinitelyTyped. Is it okay if I close the issue here because this is not a problem with Helmet?

I'd like to submit a PR to DefinitelyTyped to improve their type definitions, but that isn't exactly part of Helmet.

@juergenzimmermann
Copy link
Author

Yes, I also think it's a Problem of DefinitelyTyped.
I highly appreciate if you'd submit a PR to DefinitelyTyped.

@EvanHahn
Copy link
Member

I'll close this issue. I'll take a look at DefinitelyTyped and see if I can make a PR.

@EvanHahn
Copy link
Member

EvanHahn commented Apr 2, 2016

Made a PR (DefinitelyTyped/DefinitelyTyped#8820) for csp. I also made another for the xssFilter middleware (DefinitelyTyped/DefinitelyTyped#8818).

@EvanHahn
Copy link
Member

EvanHahn commented Apr 5, 2016

Both of my PRs were merged! @juergenzimmermann, hope this helps.

@juergenzimmermann
Copy link
Author

@EvanHahn, thank you very much for your efforts.

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

No branches or pull requests

2 participants