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
.svgfile via an<img>tag. - I just switched from Zola 0.10.0 to 0.13.0.
- In Zola 0.13.0 the
.svgfile 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-Typefor.svgfiles, leaving the browser to guess. - Both Chrome and Safari guess
xmlrather 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-typeheader. - Run
curl -I http://127.0.0.1:1111/<path to svg>in Zola 0.13.0. Note the absence of acontent-typeheader.
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
nextbranchIf 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/zolais 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 serveError:
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