You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The URL in go's standard http.Request has a Query() accessor which returns a map[string][]string (see: https://github.com/golang/go/blob/master/src/net/url/url.go#L995). This allows one to send a request with ...&type=foo&type=bar... and get both values using http.Request.Query()["type"].
The QueryStringParameters field from APIGatewayProxyRequest on the other hand is defined as a map[string]string (see: https://github.com/aws/aws-lambda-go/blob/master/events/apigw.go#L11). Supplying ...&type=foo&type=bar... to a Lambda behind GatewayProxy only returns the last value for type - bar in this case.
A workaround is to supply the parameters as a list using a separator character as in: ...&type=foo,bar...
The text was updated successfully, but these errors were encountered:
Hi @thoellrich
This limitation comes from Amazon API Gateway, and this project only reflects this fact. You should ask for a feature request on the AWS forum.
The URL in go's standard
http.Request
has aQuery()
accessor which returns amap[string][]string
(see: https://github.com/golang/go/blob/master/src/net/url/url.go#L995). This allows one to send a request with...&type=foo&type=bar...
and get both values usinghttp.Request.Query()["type"]
.The
QueryStringParameters
field fromAPIGatewayProxyRequest
on the other hand is defined as amap[string]string
(see: https://github.com/aws/aws-lambda-go/blob/master/events/apigw.go#L11). Supplying...&type=foo&type=bar...
to a Lambda behind GatewayProxy only returns the last value fortype
-bar
in this case.A workaround is to supply the parameters as a list using a separator character as in:
...&type=foo,bar...
The text was updated successfully, but these errors were encountered: