I use EvaporateJS in full compliance with official documentation and examples. My server side program works properly for signing v4, and the multipart upload is done properly.
But I have a problem with the pause and resume functions.
When I pause an upload, after resuming it, the first PUT request always gets a 403 (SignatureDoesNotMatch)
error.
After a bit more research, it seems that the reason is that the library sends the wrong stringToSign
to the server for signing on the first attempt after the resume.
This is last str_to_sign
before pausing
AWS4-HMAC-SHA256
*20220608T114339Z*
20220608/default/s3/aws4_request
**b45c4ca1a7c7744ea2f3b6507bd3452317773cf30b860f4d98de662b8f7a85b6**
This is the first str_to_sign after resuming
AWS4-HMAC-SHA256
*20220608T114345Z*
20220608/default/s3/aws4_request
**b45c4ca1a7c7744ea2f3b6507bd3452317773cf30b860f4d98de662b8f7a85b6**
As you can see above the time has been changed but the canonicalRequest values are the same.
CodePudding user response:
I think the line 1815
of the evaporate.js
should be deleted.
if (typeof this._cr !== 'undefined') { return this._cr; }