API Gateway HTTP API Proxy Integration re-encodes the query parameters

0

Hi,

Here is my configuration: mydomain.com -> API GW Custom Domain -> HTTP API -> Route (/api/{+proxy}) -> VPCLink -> ALB -> HTTPS Listener -> TargetGroup (Type: Instance) -> ECS Fargate Service

Our frontend clients sends an array as a query parameter but API GW encodes the parameters and the fargate application can not process the parameters. For example assume that client makes this request; https://mydomain.com/hello/world?key=value1,value2,value3 Request captured on backend is https://mydomain.com/hello/world?key=value1%2Cvalue2%2Cvalue3

How can I prevent this behavior? Is there any way?

Thanks

2개 답변
0
수락된 답변

We solved the problem by decoding the parameters on backend application. "Thanks" to API Gateway there are no configuration options for this particular issue

답변함 일 년 전
profile picture
전문가
검토됨 23일 전
0

It seems like URL encoding by default would be the expected behavior. If you have multiple values for the query string parameter (i.e. an array or collection) perhaps you should:

https://mydomain.com/hello/world?key=value1&key=value2&key=value3

AWS
andy
답변함 일 년 전
profile picture
전문가
검토됨 23일 전
  • Thanks for the answer. We have quite a lot of query params, using the suggested way will cause our urls to be huge. I would love to have a way to disable it or at least provide a parameter mapping to overwrite the query params with decoded ones.

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

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

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