Skip to content

fix: mockWebxdc: set Content-Type header to fix strict-MIME block in proxied environments#8

Open
experintellia wants to merge 1 commit intowebxdc:mainfrom
experintellia:add-missing-content-type
Open

fix: mockWebxdc: set Content-Type header to fix strict-MIME block in proxied environments#8
experintellia wants to merge 1 commit intowebxdc:mainfrom
experintellia:add-missing-content-type

Conversation

@experintellia
Copy link
Copy Markdown

res.end(src) without a Content-Type header causes browsers to see an empty MIME type. Under strict-MIME checking (GitHub Codespaces reverse proxy, nginx with X-Content-Type-Options: nosniff) the script is blocked with ERR_BLOCKED_BY_RESPONSE and window.webxdc is never set. Fix: add res.setHeader('Content-Type', 'application/javascript; charset=utf-8') before res.end() in configureServer. No behaviour change on localhost. Reproduces reliably in any GitHub Codespace — open the app via the forwarded-port URL and check the console.

Disclaimer: This commit was generated by the LLM Claude Sonnet 4.6. I verified myself both that it works and that this is the correct solution.

…ed environments

`res.end(src)` without a Content-Type header causes browsers to see an
empty MIME type. Under strict-MIME checking (GitHub Codespaces reverse
proxy, nginx with `X-Content-Type-Options: nosniff`) the script is
blocked with ERR_BLOCKED_BY_RESPONSE and `window.webxdc` is never set.
Fix: add `res.setHeader('Content-Type', 'application/javascript; charset=utf-8')`
before `res.end()` in `configureServer`. No behaviour change on localhost.
Reproduces reliably in any GitHub Codespace — open the app via the
forwarded-port URL and check the console.

Disclaimer: this commit was generated by the LLM Claude Sonnet 4.6. I verified myself both that it works and that it is the correct solution.
@experintellia experintellia changed the title mockWebxdc: set Content-Type header to fix strict-MIME block in proxied environments fix: mockWebxdc: set Content-Type header to fix strict-MIME block in proxied environments Apr 29, 2026
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