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(readBody): handle top-level arrays in url-encoded data #278

Merged
merged 5 commits into from
Dec 13, 2022
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves #275

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Previously a valid url-encoded string with multiple entries for the same value was not properly parsed. This creates arrays in such cases; it still doesn't support advanced nested arrays like qs but handles this specification as expected.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Dec 13, 2022
@danielroe danielroe self-assigned this Dec 13, 2022
src/utils/body.ts Outdated Show resolved Hide resolved
src/utils/body.ts Show resolved Hide resolved
src/utils/body.ts Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Merging #278 (e09702a) into main (c747f5c) will increase coverage by 0.23%.
The diff coverage is 100.00%.

❗ Current head e09702a differs from pull request most recent head 74caf25. Consider uploading reports for the commit 74caf25 to get more accurate results

@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   75.94%   76.17%   +0.23%     
==========================================
  Files          20       20              
  Lines        1218     1230      +12     
  Branches      224      228       +4     
==========================================
+ Hits          925      937      +12     
  Misses        293      293              
Impacted Files Coverage Ξ”
src/utils/body.ts 86.04% <100.00%> (+2.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 changed the title fix: handle top-level arrays in url-encoded data fix(readBody): handle top-level arrays in url-encoded data Dec 13, 2022
@pi0 pi0 merged commit b138ce1 into main Dec 13, 2022
@pi0 pi0 deleted the fix/form-arrays branch December 13, 2022 13:46
@alphaelf
Copy link

alphaelf commented Apr 3, 2023

on this line and this line can we use destr to store typed value instedof string value?, for now the undefined, true, false, null, ... values will returned as string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

not all values present when using readBody with application/x-www-form-urlencoded
3 participants