-
Notifications
You must be signed in to change notification settings - Fork 200
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
Some more potentially relevant response headers #325
Comments
Note that any response header we set comes at the expense of performance, although in most cases this is minimal. Also to ensure API compatibility, we cannot add headers and remove them afterwards, therefore we're a bit conservative in such cases. As always, feel free to use our source code to host your own solution. |
|
|
Commit f52d724 (which has just been rolled out to production) adds the following response headers to the API:
In addition to that, I just enabled the I still need to think about adding the |
I'll close this issue for now, please feel free to re-open if there's still a problem. |
Hi!
I did some more research on response headers and found the following that would be useful for you to have:
1. Cross-Origin-Resource-Policy: cross-origin
To use some features like high precision timing with
Performance.now()
you have to have cross-origin isolation on your site:http://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy
This requires all resources to have the
Cross-Origin-Resource-Policy
header for non-CORS requests (like<img>
tags without crossorigin or CSS background-image).2. X-Content-Type-Options: nosniff
Pretty much every other image host has this header on all images. Not sure if it's really needed since you transform all the images so the chance that one of them could be interpreted as a script is pretty low. But apparently site security scanners expect this to be set so that could be a benefit as well.
3. Access-Control-Expose-Headers: *
You can do this:
But this only allows you to read the default safelisted headers:
http://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_response_header
It would be useful to be able to read all headers, for example
Age
andX-Images-API
, and then maybe you can add some more headers likeX-Width
/X-Height
orX-Original-Size
(content length of the original image) or maybeX-Requested
(timestamp when the image was requested by your server).Thanks!
The text was updated successfully, but these errors were encountered: