serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.39k stars 5.7k forks source link

pathParameters should be uri decoded #5037

Open ichernev opened 6 years ago

ichernev commented 6 years ago

This is a Bug Report

Description

For bug reports:

Now try to pass /posts/@ --url encoded--> /posts/%40 and you'll get %40 in your handler forevent.pathParameters.id.

serverless version 1.27.3

paullaffitte commented 4 years ago

I would like to work on this issue, could I?

medikoo commented 4 years ago

@paullaffitte definitely, help much appreciated!

chankailong commented 4 years ago

@medikoo is the issue still opening? I want to help.

It is my first time to do the contribution.

I understand that the user wants to get the decoded value from the URL.

Can I have more instruction on how to fix it?

Thank you!

medikoo commented 4 years ago

@chankailong as I look into that, it may not be solvable in Framework. At least it appears that decoding should be done on Lambda level and we do not inject any code into lambdas.

Not sure if there's a way to guarantee that path is decoded just via AWS API Gateway request setting.