Skip to content

fix: prevent Content-Type header from being set to "false"#7184

Closed
deepview-autofix wants to merge 1 commit intoexpressjs:masterfrom
deepview-autofix:deepview/a58e64fc78
Closed

fix: prevent Content-Type header from being set to "false"#7184
deepview-autofix wants to merge 1 commit intoexpressjs:masterfrom
deepview-autofix:deepview/a58e64fc78

Conversation

@deepview-autofix
Copy link
Copy Markdown

When res.set('Content-Type', value) is called with an unrecognized MIME type, mime.contentType(value) returns false. This false was passed directly to setHeader, corrupting the Content-Type header to the literal string "false". Fall back to the original value when mime.contentType() cannot resolve the type.

When `res.set('Content-Type', value)` is called with an unrecognized
MIME type, `mime.contentType(value)` returns `false`. This `false` was
passed directly to `setHeader`, corrupting the Content-Type header to
the literal string "false". Fall back to the original value when
`mime.contentType()` cannot resolve the type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
@krzysdz
Copy link
Copy Markdown
Contributor

krzysdz commented Apr 16, 2026

Duplicate of #7035

@krzysdz krzysdz marked this as a duplicate of #7035 Apr 16, 2026
@krzysdz krzysdz closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants