Skip to content

Add param pattern support#417

Open
blakeembrey wants to merge 2 commits intomasterfrom
be/add-pattern-support
Open

Add param pattern support#417
blakeembrey wants to merge 2 commits intomasterfrom
be/add-pattern-support

Conversation

@blakeembrey
Copy link
Member

Extremely simple version of #380, meant to be a starting point for more iteration on the actual regex allowed.

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (05a5a97) to head (b4fb596).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #417   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          369       418   +49     
  Branches       132       150   +18     
=========================================
+ Hits           369       418   +49     

☔ 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.

@bjohansebas bjohansebas self-requested a review January 14, 2026 14:31
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the code looks good. Could you please update the README?

@Helveg
Copy link

Helveg commented Jan 15, 2026

Is it possible to also add other common valid URL characters like - _ ! $ & ' , ; = to the allowed characters? They seem completely innocent. Maybe even + (commonly used for spaces) and *, ?, I'm not sure they can do harm if ( ) are not allowed, perhaps they should only be allowed when they're explicitly escaped like \+, \*, \? ?

@blakeembrey
Copy link
Member Author

Is it possible to also add other common valid URL characters like - _ ! $ & ' , ; = to the allowed characters?

Absolutely, this was just a scaffold to start iterating on but I can add them to the PR. One open question on ^ and $, since they're invalid in the regex output, is whether they should be escaped? I'm leaning toward yes and documenting the supported regex features/DSL in the README clearly.

Maybe even + (commonly used for spaces) and *, ?, I'm not sure they can do harm if ( ) are not allowed, perhaps they should only be allowed when they're explicitly escaped like +, *, ? ?

Depends on if we're supporting repeat/optional features. If so, yes, they'd need to be escaped. That's where using a regex to validate completely breaks down and, with repeats, a ReDoS vector opens so it's a more complex PR.

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.

4 participants