Skip to content

Make the HTML meta prescan limit configurable - #32

Merged
domenic merged 1 commit into
mainfrom
codex/configurable-prescan
Sep 21, 2026
Merged

domenic merged 1 commit into
mainfrom
codex/configurable-prescan

Conversation

@domenic

@domenic domenic commented Sep 21, 2026

Copy link
Copy Markdown
Member

Add a maxPrescanBytes option for HTML meta encoding declarations, keeping the 1024-byte default and supporting larger, smaller, or unlimited scans.

Add `maxPrescanBytes` so callers can recognize HTML meta encoding declarations beyond the default 1024-byte window. Accept non-negative integer limits, with `0` disabling meta scanning, or `Infinity` to scan the entire input.

Apply the limit only to HTML meta scanning; XML declarations and UTF-16 byte signatures are unrestricted. Reject invalid limits with `RangeError`, and reject any non-`undefined` value in XML mode with `TypeError`.

Fixes #10.

Co-Authored-By: codex <codex@openai.com>
@domenic
domenic merged commit 11c403c into main Sep 21, 2026
5 checks passed
@domenic
domenic deleted the codex/configurable-prescan branch September 21, 2026 06:58
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