X-Amz-Content-Sha256 not being generated
Opened this issue · 3 comments
cjorge commented
By the sigv4 documentation this is a mandatory header to be generated.
I can't seem to find a way of creating it. Is this a bug?
mhart commented
Which documentation? It's not mandatory for sigv4 signing alone – but some services use it (eg, S3). Most services don't though.
cjorge commented
Yes, I didn't explain myself correctly... but could there be an optional parameter to expose this header?
mhart commented
Expose how? Sorry, can you explain what you're trying to do?
You can set this header yourself and aws4fetch should continue to work fine (in fact, it will use it for the signing and save having to calculate it)
If you want it yourself you can just do something like:
import { AwsV4Signer } from 'aws4fetch';
const signer = new AwsV4Signer({ url: '...', body: '...', ... });
const bodyHash = await signer.hexBodyHash();