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 support for setting custom headers for files uploaded to S3 #7
Conversation
Bump @e-dard :) I've also got a commit fixing an issue where setting the header But we'll take in another PR if you want to merge this one. |
OK, finally got some time to sit down and look at this 😄 I've been completely off-base with Flask for while, as my new gig is mainly a Ruby shop... Unfortunately I merged the previous PR with too much haste, and I really wish I hadn't 💣. The solution you propose, here, is clearly a much better alternative. However, now I've gone and sullied my once relatively tidy extension, I'm going to have to live with it. Your PR will break Flask S3 as it stands, because existing deployments may (will) be using
I will add some line comments to clarify the above. Don't worry if these changes are too much to ask, I'll get around to them eventually. I promise a quick review if you decide to do them, though 😆 |
set to `True`. | ||
`S3_USE_CACHE_CONTROL` Specifies whether or not to set the metadata for the | ||
Cache-Control headers. | ||
**Default:** `False` |
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.
For both of these settings I would simply add
Deprecated. Please use
S3_HEADERS
instead.
No problem! I understand that you need backwards compatibility, somehow I managed to not think about that. I'll give it a shot and come back to you. |
See http://developer.yahoo.com/performance/rules.html#expires | ||
for more information. | ||
|
||
**Default:** `{}` | ||
=========================== =================================================== |
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 code block looks gnarly in the table for some reason. Thinking about it, it may be better just to keep the documentation here to:
Sets custom headers to be sent with each file to S3.
Default:{}
And then after Uploading your Static Assets add another very short section: Setting Custom HTTP Headers, outlining how to use S3_HEADERS
(along with relavant links — on that note can you use the foo_
and .. _foo http://bar.com
notation?)
Adds support for setting custom HTTP headers, on files uploaded to S3
Thanks @hannseman! |
Thanks for the merge! @e-dard |
Today there's only support for setting the
Cache-Control
header. I've removed theS3_CACHE_CONTROL
setting and addedS3_HEADERS
which supports setting whatever header you want: