zola: The Zola 0.13.0 server no longer provides a `content-type` for any files, leaving the browser to guess the type of all files.
Bug Report
Environment
Zola version: 0.13.0
Expected Behavior
- The main page of my site loads an
.svg
file via an<img>
tag. - I just switched from Zola 0.10.0 to 0.13.0.
- In Zola 0.13.0 the
.svg
file is no longer served correctly.
Current Behavior
- Zola 0.10.0 served the file with the correct
Content-Type
,image/svg+xml
. - Zola 0.13.0 provides no
Content-Type
for.svg
files, leaving the browser to guess. - Both Chrome and Safari guess
xml
rather thansvg
.
In fact, Zola 0.13.0 no longer provides the Content-Type
for any files, leaving the browser to guess the type of all files.
Step to reproduce
- Create a basic site.
- Add an
svg
-based<img>
to the site’s main page. - Serve the site in Zola 0.10.0. The
<img>
is presented correctly. - Serve the site in Zola 0.13.0. The
<img>
is not presented correctly. - Run
curl -I http://127.0.0.1:1111/<path to svg>
in Zola 0.10.0. Note the presence of acontent-type
header. - Run
curl -I http://127.0.0.1:1111/<path to svg>
in Zola 0.13.0. Note the absence of acontent-type
header.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 16 (4 by maintainers)
Commits related to this issue
- serve command respects mime types (closes #1308) — committed to southerntofu/zola by deleted user 3 years ago
- Merge pull request #1311 from southerntofu/bugfix-mimetype bugfix: serve command respects mime types (closes #1308) — committed to getzola/zola by Keats 3 years ago
- Update slotmap + handle in memory XML content type in zola serve Second part of #1308 — committed to getzola/zola by Keats 3 years ago
- serve command respects mime types (closes #1308) — committed to da-x/zola by deleted user 3 years ago
It should be fixed in the
next
branchIf you’d like to try to build it, it doesn’t have to be complicated. If you have rust installed on your machine, it’s as easy as:
Where
/PATH/TO/zola
is the full path to where zola should be installed. On most platforms,/usr/local/bin/
will be a good place. Note these commands only work on UNIX-based systems (including macOS), so if you’re running windows you’ll have to dig into it or wait for the next release 😃makes sense
Think I just got this issue in v0.13 when using Javascript modules during
zola serve
Error:
failed to load module script: expected a javascript module script but the server responded with a mime type of "". strict mime type checking is enforced for module scripts per html spec.
So, I tested it with next-build. It’s Fixed thankfully