Get actual request path in API Gateway HTTP API

1

The event payload v2.0 of an HTTP API contains a "rawPath" field. However, this does not contain the actual raw request path. It seems to go through some kind of normalization.

For example, a request such as: https://example.com//foo//bar will return "/foo/bar" without the excess slashes. I would like to be able to somehow retrieve that is was "//foo//bar" so I can issue a 301 redirect to the proper corrected path. Is there any trick to get this? Is this a bug?

I do notice that payload v1.0 returns the desired raw request at "path". However, I'd rather not go back to an older, possibly future deprecated version.

1개 답변
0

You can see from the Schema that it will not provide the Full URL: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format.

You can connect it to Lambda, print out the event and look at your cloudwatch logs to determine which of them provides the desired value.

AWS
vtjean
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠