You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
If the endpoint is of the style s3.amazonaws.com/bucket.name/, the V4 signature expects the canonical header to be in the form:
PUT
/Bucket.Name/Path/To/File.txt
uploads=
host:s3.amazonaws.com
x-amz-content-sha256:...
However with the current version (5.15.0) the canonical header looks like this:
PUT
/Path/To/File.txt
uploads=
host:s3.amazonaws.com/Bucket.Name
x-amz-content-sha256:...
This causes the signature to be invalid. I have written a server-side workaround to fix the canonical header, but eventually it seems like it would be best to fix this in the code, at the following location possibly:
getCanonicalRequest: function(signatureSpec) {
return qq.format("{}\n{}\n{}\n{}\n{}\n{}",
signatureSpec.method,
v4.getCanonicalUri(signatureSpec.endOfUrl), // this should include /Bucket.Name/ at the beginning
v4.getCanonicalQueryString(signatureSpec.endOfUrl),
signatureSpec.headersStr || "\n", // if there is a host header, it should exclude the /Bucket.Name
v4.getSignedHeaders(signatureSpec.headerNames),
signatureSpec.hashedContent);
},
The text was updated successfully, but these errors were encountered:
I ended up manually altering the canonical header on my server, just before i did all the hashing and other stuff. As I recall, it was as simple as taking the bucket name from the "host" line and moving it to the beginning of the path, which i think is the next line.
Type of issue
Uploader type
canonical header is not being generated correctly if the endpoint is of the style `s3.amazonaws.com/bucket.name/`
Fine Uploader version
{example: 5.15.0}
Browsers where the bug is reproducible
Chrome or Firefox (presumably all browsers)
Operating systems where the bug is reproducible
(presumably all, tested on Windows 10)
All relevant Fine Uploader-related code that you have written
Detailed explanation of the problem
If the endpoint is of the style
s3.amazonaws.com/bucket.name/
, the V4 signature expects the canonical header to be in the form:However with the current version (5.15.0) the canonical header looks like this:
This causes the signature to be invalid. I have written a server-side workaround to fix the canonical header, but eventually it seems like it would be best to fix this in the code, at the following location possibly:
fine-uploader/client/js/s3/request-signer.js
Line 134 in a513777
The text was updated successfully, but these errors were encountered: