s3upload-coffee-javascript
s3upload-coffee-javascript copied to clipboard
unnecessary decodeURIComponent?
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}",
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.
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..
+1 to @1john's bug fix request. Just lost a whole bunch of time debugging this issue.