Skip to content

fix(req): don't throw if the query param is invalid #4110

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yusukebe
Copy link
Member

@yusukebe yusukebe commented Apr 25, 2025

Fixes #3952

The code is based on #3952 (comment)

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Copy link

Bundle size check

main (15a83b1) #4110 (6cf0cd9) +/-
Bundle Size (B) 18,904B 18,906B 2B
Bundle Size (KB) 18.46K 18.46K 0K

Compiler Diagnostics

main (15a83b1) #4110 (6cf0cd9) +/-
Files 261 261 0
Lines 116,434 116,434 0
Identifiers 114,428 114,429 1
Symbols 303,852 303,852 0
Types 214,828 214,828 0
Instantiations 3,091,594 3,091,594 0
Memory used 445,293K 455,816K 10,523K
I/O read 0.03s 0.02s -0.01s
I/O write 0s 0s 0s
Parse time 0.66s 0.67s 0.01s
Bind time 0.28s 0.28s 0s
Check time 5.84s 5.77s -0.07s
Emit time 0s 0s 0s
Total time 6.78s 6.73s -0.05s

Reported by octocov

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.30%. Comparing base (15a83b1) to head (44068d6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4110   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files         168      168           
  Lines       10780    10780           
  Branches     3085     3063   -22     
=======================================
  Hits         9843     9843           
  Misses        936      936           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yusukebe
Copy link
Member Author

Hey @usualoma !

Can you review this? (It's actual, so we can include it in the patch release.)

@yusukebe
Copy link
Member Author

Oh. URLSearchParams does not throw the error if parsing %E0%A4%A.

const query = 'foo=%E0%A4%A'

const params = new URLSearchParams(query)
console.log(params) // URLSearchParams { 'foo' => '�%A' }

We should consider it. There is a possibility to merge #3565 that uses URLSearchParams for the parse queries. So, the behavior of this PR and that PR will differ. I'll make this PR a draft.

@yusukebe yusukebe marked this pull request as draft April 25, 2025 09:38
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.

prettyJSON throws on invalid query parameters
1 participant