Skip to content

fix(util): correct JSONL_CONTENT regex syntax and alternation grouping - #97

Open
Adityakk9031 wants to merge 1 commit into
context-dot-dev:mainfrom
Adityakk9031:fix/jsonl-content-type-regex
Open

Adityakk9031 wants to merge 1 commit into
context-dot-dev:mainfrom
Adityakk9031:fix/jsonl-content-type-regex

Conversation

@Adityakk9031

@Adityakk9031 Adityakk9031 commented Oct 24, 2026 •

Copy link
Copy Markdown

Noticed a couple of regex issues in JSONL_CONTENT:

  • (:? was typed instead of non-capturing (?: in two places.
  • The alternations weren't grouped under ^application/, so the second half (jsonl) could match anywhere in arbitrary content types (e.g. text/jsonl or headers with filename=foo.jsonl).

Updated the pattern to ^application/(?:x-(?:n|l)djson|(?:x-)?jsonl) and added test cases for valid and invalid content-types.

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.

1 participant