Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
kookster opened this Issue · 1 comment

2 participants

@kookster

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')
@GreenAsJade
Owner

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
Something went wrong with that request. Please try again.