Skip to content

Fix null Content-Type in range request responses#4

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-playwright-bug-diagnosis
Draft

Fix null Content-Type in range request responses#4
Copilot wants to merge 3 commits intomainfrom
copilot/fix-playwright-bug-diagnosis

Conversation

Copy link

Copilot AI commented Feb 15, 2026

_serveRangeFile in HttpServer uses a non-null assertion on mime.getType(), sending Content-Type: null for files with unrecognized extensions. The sibling _serveFile method already handles this correctly with a fallback.

- 'Content-Type': mime.getType(path.extname(absoluteFilePath))!,
+ 'Content-Type': mime.getType(path.extname(absoluteFilePath)) || 'application/octet-stream',
  • Fix: Add || 'application/octet-stream' fallback to _serveRangeFile, matching _serveFile behavior
  • Tests: Added http-server.spec.ts covering Content-Type for range requests on both known (.html) and unknown extensions
  • Docs: Added BUG_DIAGNOSIS.md per request

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 15, 2026 21:21
The _serveRangeFile method used a non-null assertion on mime.getType()
which sent Content-Type: null for unrecognized file extensions. Added
the same || 'application/octet-stream' fallback that _serveFile uses.

Co-authored-by: rwoll <[email protected]>
Copilot AI changed the title [WIP] Fix bug in Playwright as described in README.md Fix null Content-Type in range request responses Feb 15, 2026
Copilot AI requested a review from rwoll February 15, 2026 21:25
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.

2 participants