-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
bugfix(#2152): Docs not support "http" markdown image #2171
bugfix(#2152): Docs not support "http" markdown image #2171
Conversation
packages/bruno-electron/src/index.js
Outdated
"font-src 'self' https:", | ||
// this has been commented out to make oauth2 work | ||
// "form-action 'none'", | ||
"img-src 'self' blob: data: https:", | ||
"img-src 'self' blob: data: http: https:", | ||
"media-src 'self' blob: data: https:", | ||
"style-src 'self' 'unsafe-inline' https:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this, I wonder why HTTP would be fine for images but at the same time not for fonts, styles or other media.
I think, if the content security policy is changed, the change should be consistently applied to all kinds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the user can embed an Image from an HTTP-Server in the Docs. But users can't link any fonts etc. And I think we should use the most strict rules if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I also thought about it but i didn't want to open security breaches without a need for it. It seems unlikely someone will include a font in the markdown editor, i don't think it's even possible. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry i didn't see @Its-treason response before so i agree to only allow images because they can be linked in the markdown editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense. 👍
Maybe it's worth adding the reasoning to the code as an inline comment. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i can't now but i will later unless you can do it before.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested a change because I can't directly edit the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is added now.
Thanks.
Merged. Thank you @busy-panda ! Thanks for the review @Its-treason @andreassiegel ! |
…no#2171) * bugfix(usebruno#2152): Docs not support "http" markdown image * fix: added documentation (usebruno#2152)
resolves: #2152
Description
The error message was:
Refused to load the image 'http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png' because it violates the following Content Security Policy directive: "img-src 'self' blob: data: https:".
Electron was not allowing to load images over "http", only "https" was allowed.
I think it's reasonable to allow it (for images only).
images.mp4
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.