Skip to content

Require { or [ for JSON detection - #9

Merged
andrew merged 1 commit into
mainfrom
json-require-container
Sep 4, 2026
Merged

Require { or [ for JSON detection#9
andrew merged 1 commit into
mainfrom
json-require-container

Conversation

@andrew

@andrew andrew commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Bare top-level scalars are valid JSON per RFC 8259, but classifying a file containing only 12345 or true as application/json produces false positives for content sniffing. Match file(1) and only report JSON when the document opens a container.

Bare scalars (numbers, strings, true/false/null) are valid JSON
per RFC 8259 but classifying a file containing only "12345" as
application/json produces false positives for content sniffing.
@andrew
andrew merged commit f2456e7 into main Sep 4, 2026
4 checks passed
@andrew
andrew deleted the json-require-container branch September 4, 2026 11:34
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