Closed smcstewart closed 4 years ago
Agreed. Setting GO_API_HOST
appears to require a change to the router configuration as the API Gateway stage comes into play.
It would be nice if the https://godoc.org/github.com/aws/aws-lambda-go/events#APIGatewayProxyRequestContext request context could be passed through if this can't be changed along with https://golang.org/pkg/net/http/#NewRequestWithContext
I recently added DomainName
and some other properties to APIGatewayProxyRequestContext
type in aws-lambda-go
. The changes have been published in v1.17.0. This allows domain name to be inferred from APIGatewayProxyRequestContext.DomainName
.
Please upvote the PR here: https://github.com/awslabs/aws-lambda-go-api-proxy/pull/67
I know this has been looked at previously in #13 and associated PR, but with API GW returning the host, is there any reason not to default to the host as passed in the
APIGatewayProxyRequest
instead of theDefaultServerAddress
? I can understandhttps://aws-serverless-go-api.com
being a fallback if no host is passed from API GW, but defaulting to the actual host would get us closer to the integrity of the original http request.