Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin-api): nested parameters can be parsed correctly when using form-urlencoded requests #13668

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ms2008
Copy link
Contributor

@ms2008 ms2008 commented Sep 14, 2024

Summary

When using curl to send a form-urlencoded request with nested parameters, such as

$ curl -X POST http://localhost:8001/parsed_params \
   --data 'items[1]=foo' \
   --data 'items[2]=bar'

the expected response is {"items":["foo","bar"]}, but instead, it returns {"items":{}}.

This is actually an EE issue, but I see that there is a risk of this in CE even though it doesn't currently occur. So I initiated that fix on CE.

The cause of the problem is due to the fact that nested parameters are lost when the decode_args method is called twice, without this fix.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix FTI-6165

@github-actions github-actions bot added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Sep 14, 2024
@pull-request-size pull-request-size bot added size/S and removed size/M labels Sep 14, 2024
@ms2008 ms2008 marked this pull request as ready for review September 14, 2024 04:05
@pull-request-size pull-request-size bot added size/M and removed size/S labels Sep 14, 2024
@ms2008 ms2008 changed the title fix(admin-api): nested parameters can be parsed correctly when using … fix(admin-api): nested parameters can be parsed correctly when using form-urlencoded requests Sep 14, 2024
@team-gateway-bot team-gateway-bot added the author/community PRs from the open-source community (not Kong Inc) label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author/community PRs from the open-source community (not Kong Inc) cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/admin-api size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants