Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Need to use utc time for calculating expiration_date in S3UploadsController #1

Open
kookster opened this Issue Aug 28, 2009 · 1 comment

Comments

Projects
None yet
2 participants

I also posted this on the elcgit parent of this fork, but you seem to be making updates more often, so thought you might incorporate it sooner.

If you have used newish RoR ability to set a time zone, then you need to make sure the expiration_date included in the policy block for s3 is utc.

Line 30:

expiration_date = 1.hours.from_now.strftime('%Y-%m-%dT%H:%M:%S.000Z')

Should be:

expiration_date = 1.hours.from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z')
Owner

GreenAsJade commented Aug 29, 2009

Thanks for the heads-up.

Can I check: you are recommending this change in controller.rb, which is a template.

So new users who pick up this plugin will get the change automatically, but existing users will need to manually patch their previously-generated local copy of controller.rb, right? I'm asking because I can't think of a more elegant and yet still safe way to propagate this change, but I might be missing the obvious :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment