Skip to content

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

Closed
pieter (importpieter) wants to merge 1 commit into
microsoft:mainfrom
importpieter:fix-40422
Closed

fix(glob): treat unbalanced braces as literals in globToRegexPattern#40558
pieter (importpieter) wants to merge 1 commit into
microsoft: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/playwright#40422
@importpieter

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Skn0tt

Copy link
Copy Markdown
Contributor

Closing in favour of #40442

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 }

2 participants