-
Notifications
You must be signed in to change notification settings - Fork 31
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
Replace X-Frame-Options with Content-Security-Policy #21
Comments
In addition to providing finer grained options than |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
X-Frame-Options is a header included in the response to the request to state if the domain requested will allow itself to be displayed within a frame. It has nothing to do with javascript or HTML, and cannot be changed by the originator of the request. You can't set X-Frame-Options on the iframe. That is a response header set by the domain from which you are requesting the resource . They have set the header to SAMEORIGIN in this case, which means that they have disallowed loading of the resource in an iframe outside of their domain. So you cannot embed their website into yours. Browsers when see that the response header contains X-Frame-Options: SAMEORIGIN, they check your domain and block the rendering of the <iframe>. It is a security measure to avoid clickjacking. |
Just looked at https://caniuse.com/x-frame-options which says that only |
Just curious is there has been any update on this? |
No update I'm afraid, but thanks for raising it. cc @knabar |
If the goal is to support all the options, I'm right now leaning towards a single |
X-Frame-Options
with values other thandeny
andsameorigin
has limited browser support, and only supports a single domain: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-OptionsReplace it with the much more flexible
Content-Security-Policy
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy which deprecatesX-Frame-Options
https://www.w3.org/TR/CSP2/#frame-ancestors-and-frame-optionsDjango CSP module: https://github.com/mozilla/django-csp
Original requirement: https://forum.image.sc/t/cors-white-listing/29457/7
The text was updated successfully, but these errors were encountered: