Skip to content

Fix parse_query decoding multiple plus signs#921

Open
mugiwaraluffy56 wants to merge 1 commit into
gleam-lang:mainfrom
mugiwaraluffy56:fix-parse-query-multiple-plus
Open

Fix parse_query decoding multiple plus signs#921
mugiwaraluffy56 wants to merge 1 commit into
gleam-lang:mainfrom
mugiwaraluffy56:fix-parse-query-multiple-plus

Conversation

@mugiwaraluffy56
Copy link
Copy Markdown
Contributor

@mugiwaraluffy56 mugiwaraluffy56 commented May 7, 2026

This fixes the JavaScript implementation of uri.parse_query so all plus signs in query keys and values are decoded as spaces, matching the Erlang target.

The previous JavaScript implementation used String.prototype.replace, which only replaced the first plus sign. This now uses replaceAll and adds a regression test for multiple plus signs in both the key and value.

Verification:

  • git diff --check
  • Node expression confirmed replace only handles the first plus while replaceAll handles all plus signs
  • Erlang uri_string:dissect_query confirmed the expected decoded result

@lpil
Copy link
Copy Markdown
Member

lpil commented May 7, 2026

Hi @mugiwaraluffy56 ! How come you closed this? Thank you

@mugiwaraluffy56
Copy link
Copy Markdown
Contributor Author

mugiwaraluffy56 commented May 7, 2026

hey @lpil, I thought one PR at a time would be a good practice, so that’s why I closed this 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants