Skip to content

Fix response header for WASM assets during jekyll serve#8938

Closed
ashmaroli wants to merge 1 commit intojekyll:masterfrom
ashmaroli:fix-local-wasm-response-header
Closed

Fix response header for WASM assets during jekyll serve#8938
ashmaroli wants to merge 1 commit intojekyll:masterfrom
ashmaroli:fix-local-wasm-response-header

Conversation

@ashmaroli
Copy link
Copy Markdown
Member

  • This is a 🐛 bug fix.

Summary

.wasm files cannot be served with response header application/wasm; charset=utf-8.
Therefore, don't inject UTF-8 charset for application/wasm mime-type.

Context

Resolves #8936
/cc @daveyarwood

@parkr
Copy link
Copy Markdown
Member

parkr commented Jan 18, 2022

This seems like a bandaid that gets around the real problem: binary types don't have a charset. We use mime-db (or did, anyway) to generate the mime.types file, and it does include if there's a charset. Perhaps we could write this such that we add the charset for types which support it? https://github.com/jshttp/mime-db#data-structure https://github.com/jshttp/mime-db/blob/master/db.json

Only text-based files have a charset, all others are binary, so if we can solve this for all binary formats then we can also solve this for wasm.

@ashmaroli
Copy link
Copy Markdown
Member Author

Only text-based files have a charset, all others are binary...

[insert now why didn't I think of that emoji]
Excellent point @parkr. So, should Jekyll's mime.types include a new cell containing charset data for applicable types?

@jekyllbot jekyllbot added the has-pull-request Somebody suggested a solution to fix this issue label Feb 10, 2022
@ashmaroli ashmaroli deleted the fix-local-wasm-response-header branch February 27, 2022 09:21
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age has-pull-request Somebody suggested a solution to fix this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: jekyll serve sets the wrong content type for .wasm files

3 participants