Open cfbao opened 5 hours ago
Hi there and welcome to this repository!
A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.
Describe the bug
Requests with "connection" header are rejected by API Gateway HTTP API with IAM auth.
To Reproduce
aws apigatewayv2 create-api
){"message":"Forbidden"}
responseSample code
Expected behavior
The request is accepted.
Desktop (please complete the following information):
Windows 10 & Amazon Linux 2023
Additional context
Although not explicitly documented, it looks like AWS simply doesn't accept some headers in the signature (they accept them in the request, but not in the signature calculation). See an explicit case here with the "connection" header: https://repost.aws/questions/QUWXtAMiggShedgHG3hLl3tg/ses-sigv4-usage-update-connection-header
Other libraries (including AWS SDKs) deal with this by hardcoding (& maintaining) a list of unsignable headers and/or allow users to supply a list of headers to sign/not sign. e.g.
Supporting customization also makes it possible to use this package in environments where a proxy may alter request headers.