Skip to content

fix(glob): treat unbalanced braces as literals in globToRegexPattern#40558

Open
importpieter wants to merge 1 commit intomicrosoft:mainfrom
importpieter:fix-40422
Open

fix(glob): treat unbalanced braces as literals in globToRegexPattern#40558
importpieter wants to merge 1 commit intomicrosoft:mainfrom
importpieter:fix-40422

Conversation

@importpieter
Copy link
Copy Markdown

Summary

  • An unmatched { emitted an unclosed regex group (, and an unmatched } emitted an unmatched ) — both produce SyntaxError when the regex is compiled at match time, silently aborting the intercepted request with ERR_ABORTED
  • Fix: look ahead for a closing } before emitting the group opener; only close the group when actually inside one
  • Unbalanced braces are now treated as literals, consistent with how most glob libraries behave

Fixes #40422

An unmatched '{' emitted an unclosed regex group '(' and an unmatched
'}' emitted an unmatched ')'. Both produce SyntaxError at match time,
silently aborting the intercepted request with ERR_ABORTED.

Fix: look ahead for a closing '}' before emitting the group opener, and
only close the group when we are actually inside one.

Fixes: microsoft#40422
@importpieter
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

page.route() silently aborts navigation when glob contains unbalanced { or }

1 participant