Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X-Amz-Content-Sha256 not being generated #66

Open
cjorge opened this issue Apr 19, 2024 · 3 comments
Open

X-Amz-Content-Sha256 not being generated #66

cjorge opened this issue Apr 19, 2024 · 3 comments

Comments

@cjorge
Copy link

cjorge commented Apr 19, 2024

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
Copy link
Owner

mhart commented Apr 19, 2024

Which documentation? It's not mandatory for sigv4 signing alone – but some services use it (eg, S3). Most services don't though.

@cjorge
Copy link
Author

cjorge commented Apr 19, 2024

Yes, I didn't explain myself correctly... but could there be an optional parameter to expose this header?

@mhart
Copy link
Owner

mhart commented Apr 20, 2024

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants