Fix response header for content served via jekyll serve#8965
Fix response header for content served via jekyll serve#8965jekyllbot merged 7 commits intojekyll:masterfrom
jekyll serve#8965Conversation
parkr
left a comment
There was a problem hiding this comment.
This is great, thank you! My primary feedback is to consider slimming down the database to just the data we need. More detailed comment left in-line.
emulating Jekyll's DataReader
Co-authored-by: Parker Moore <237985+parkr@users.noreply.github.com>
parkr
left a comment
There was a problem hiding this comment.
Thanks for updating! I like the smaller list. Oddly... it feels like we're missing some MIME types like text/html which are clearly text-based and would likely . 🤔 Left a comment inline.
|
|
||
| config = File.expand_path "../lib/jekyll/mime.types", __dir__ | ||
| File.write(config, output) | ||
| log_info "Done! See: #{config.inspect.white}" |
There was a problem hiding this comment.
It was initially. =)
But the green in the middle kinda felt like it broke the flow for me.. :)
Yeah. I agree. |
|
The DB provides the default charset that IANA specified for a MIME type. This code was introduced to fix the bug where a lot of text documents don't have a default charset (which generally means it uses ASCII). I think we found a good solution for adding the charset to files with characters (text files mostly) and remove the charset header from files without characters like WASM. Great work! 👍 |
|
@jekyllbot: merge +fix |
Ashwin Maroli: Fix response header for content served via `jekyll serve` (#8965) Merge pull request 8965
Backport #8965 for v3.9.x: Fix response header for content served via `jekyll serve`

Summary
Use
script/vendor-mimesto generate a JSON version of the data used to generatelib/jekyll/mime.typesand use that JSON duringjekyll serveto determine whethercharset=has to be injected to the"content-type "in the response-header.script/vendor-mimesto generatelib/jekyll/commands/serve/mime_types.json.script/vendor-mimesto log statements during runtime.jekyll serve.lib/jekyll/mime.typeswith current data at upstream repository.Context
Closes #8938
Resolves #8936