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

Add data: uris #16

Closed
gdhnz opened this issue Jun 20, 2017 · 5 comments
Closed

Add data: uris #16

gdhnz opened this issue Jun 20, 2017 · 5 comments

Comments

@gdhnz
Copy link

gdhnz commented Jun 20, 2017

Not sure if this is possible or not but is there a way to allow additional schemes? Either by an additional class method or via a json config.

Refused to load data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 because it does not appear in the img-src directive of the Content Security Policy.

@paragonie-scott
Copy link
Member

This has always been possible from JSON, but in the next release you can just do this:

$cspBuilder->setDataAllowed('img-src', true);

@gdhnz
Copy link
Author

gdhnz commented Jul 24, 2017

Is there documentation on how to do it via JSON? I couldn't seem to find anything hence why I raised the issue.

@paragonie-scott
Copy link
Member

It's in the example:

...

    "img-src": {
        "self": true,
        "data": true
    },
...

@gdhnz
Copy link
Author

gdhnz commented Jul 24, 2017

I'm blind. Sorry.

@paragonie-scott
Copy link
Member

No problem at all. Thank you for reporting the issue in the first place, it made me aware of a usability oversight that I hadn't considered previously, so it made CSP-Builder better. :)

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

No branches or pull requests

2 participants