-
Notifications
You must be signed in to change notification settings - Fork 167
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
Go client verification fails if svix-signature header is an array of strings #880
Comments
This feels like a bug with the AWS lambda library, as these headers are not defined as comma-separated headers, so they shouldn't be split as such. What's the behavior in non lambda Go web frameworks? Any idea? |
Yeah, I dug up into it: the API Gateway V2 client is splitting every header considering them as comma separated. Different behavior compared to V1, though.
I don't have clues on other frameworks I objectively agree that this is more an issue on the AWS client side as they are treating a custom header as a comma separated one. Actually, they are treating all headers as comma separated. Thanks anyway, closing this |
It's still a concern to be honest, it makes the lives of verifies more difficult if they have to workaround bad implementations. :| |
Yeah, here the reference where I'm asking about it: awslabs/aws-lambda-go-api-proxy#171 |
Let's see what they say. Thanks for the link! |
Bug Report
Version
v0.82.1
Platform
Description
While verifying webhooks inside an AWS lambda, the standard approach to get an
http.Request
from the lambda's event, creates thesvix-signature
http.Request.Header
by splitting the original signature.http.Request.Header["svix-signature"]
results in an array of two stringsinstead of an array of a single string
{"v1,doqUF7tykdkLqUxzXTUyeoc4JIxGtOjt6kDsomething"}
This causes the
Verify
method to fail as it uses calling thehttp.Request.Header.Get
returns only first value (in this casev1
) instead of the two strings array.I expected this library to support this case as using AWS lambdas is a pretty popular.
I temporary workaround it by overriding the request header
but I expected the library to internally handle it. For example, inside the
verify
method there could be a check like:The text was updated successfully, but these errors were encountered: