Closed drappier-charles closed 1 year ago
Look like they got the same issue at the end https://github.com/mhart/aws4fetch/issues/39
You can now do this using extraHeadersToInclude
:
aws4.sign({
service: 'mycustomservice',
path: '/whatever',
headers: {
'Range': 'bytes=200-1000, 2000-6576, 19000-'
},
extraHeadersToInclude: {
'range': true
}
})
Usecase : I have an rclone client and I try to do that command : $ rclone copy myinstance:mybucket:test.csv test.csv
It generate a signature from an access_key / access_secret_key couple That signature use a range header cause my file is a file of 500meg
In a middleware I use aws4 library to compute the signature with all the needed data (same couple of key + request information send by rclone)
The signature is not the same, cause aws4 library remove the range header I've found it's hardcoded to ignore it (at signature time)
I've fork the library to set range to false, it appear to not be overridable with a configuration My question here is, why do you ignore that header? Is there a reason? (other bug?) I understand that's it's a combination of multiple library https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34 Apparently in aws4fetch they ignore it, but as they don't have same usecase I'm not sure it's a good reference.
Thanks by advance, I think best way to go with it, could be to have it in option, keeping your current standard configuration