s3upload-coffee-javascript icon indicating copy to clipboard operation
s3upload-coffee-javascript copied to clipboard

unnecessary decodeURIComponent?

Open philfreo opened this issue 12 years ago • 3 comments

this line - https://github.com/tadruj/s3upload-coffee-javascript/blob/master/s3upload.coffee#L61 seems like it has an unnecessary decodeURIComponent obviously i can make it work by making my server urlencode the value before json encoding it... but what's the point, if it's just going to be decoded?

if you removed it then you could also simplify your tutorial (i'm assuming the tutorial is yours, but maybe not) example from: signed_request: CGI::escape("#{S3_URL}#{S3_BUCKET_NAME}/#{objectName}?AWSAccessKeyId=#{S3_ACCESS_KEY}&Expires=#{expires}&Signature=#{sig}"), to signed_request: "#{S3_URL}#{S3_BUCKET_NAME}/#{objectName}?AWSAccessKeyId=#{S3_ACCESS_KEY}&Expires=#{expires}&Signature=#{sig}",

philfreo avatar Dec 05 '12 18:12 philfreo

I encountered this issue as well; it also breaks when the signature contains +. Server-side encodes this to %2b, then the javascript decodes it back to + at the line @philfreo points to. This ends up as a + on the wire. S3 decodes that to (single space), thus breaking everything.

dpassage avatar Aug 03 '14 21:08 dpassage

I just encountered this problem too. Seems to me like the decodeURIComponent call is completely unnecessary and is what is causing issues with "+" signs creating 403 forbidden errors.

I removed the call to decodeURIComponent and everything is working nicely.

Can we get a bug fix here? Spent too many hours on this..

1john avatar Apr 08 '15 21:04 1john

+1 to @1john's bug fix request. Just lost a whole bunch of time debugging this issue.

b5 avatar Sep 23 '15 18:09 b5