s3-swf-upload-plugin icon indicating copy to clipboard operation
s3-swf-upload-plugin copied to clipboard

Need to use utc time for calculating expiration_date in S3UploadsController

Open kookster opened this issue 15 years ago • 1 comments

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')

kookster avatar Aug 28 '09 20:08 kookster

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 :)

GreenAsJade avatar Aug 29 '09 01:08 GreenAsJade