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

index.js: Add "data:" as an allowed image source in CSP #19

Merged
merged 1 commit into from Apr 21, 2021
Merged

index.js: Add "data:" as an allowed image source in CSP #19

merged 1 commit into from Apr 21, 2021

Conversation

ghost
Copy link

@ghost ghost commented Apr 21, 2021

The Content-Security-Policy header that is automatically generated by Send currently does not include data: as an allowed image source. This leads to an error in the browser console when uploading files because the spinning circle that should be displayed during the upload process is loaded via data: URLs.

Refused to load the image 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPElEQVRYR+2TsUrDUBSGv3uz1MUh6eALaEBcBVcfQpeCDm6CclWcHPQB1IrPUBd9A10EnyGCUnAouIQI0kmb5kqsgdiakDYNLjdT4J7zny/fyRVM8jT9E4Q8lpYm6uOD9KQVPkZ9q40UbQhu2Z3/KBItihSN1PwA5PQ+gW7RC684nHvJm1EVQDKzC6KFsrezIEoBDFYwiMh/l/coe/UviFIAY61P62f26u5wz2QA6ZTT1zpWzQXtIvQysAliJgOui3Jm02flAYYnnfkLsmZtRD19lLEaD+UsJW3TB0iSL4I14DrDxA3KWY/PqgOI0y+DRSK8XxCaDlo02LcfqgeIJ5y/28gw+B5m6Tv9KbY4cDrVryD92c23BoIVlL0z/Vsw1l0cLa72HygAZwCMAWPAGDAGjAFjwBgwBv7dwBdvs18hh/In1gAAAABJRU5ErkJggg==' because it violates the following Content Security Policy directive: "img-src 'self'".

This pull request fixes this issue by adding data: as an allowed image source in Send's CSP generator.

Signed-off-by: Aaron <admin@datahoarder.dev>
@timvisee
Copy link
Owner

Nice catch. Thanks!

@timvisee timvisee merged commit 1ce2a60 into timvisee:master Apr 21, 2021
@ghost ghost deleted the patch-1 branch April 21, 2021 19:50
@timvisee
Copy link
Owner

timvisee commented Apr 21, 2021

I've published this as part of v3.4.9.

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

Successfully merging this pull request may close these issues.

None yet

1 participant