Zola: livereload.js is served with content-type text/plain

Created on 18 Apr 2019  ·  4Comments  ·  Source: getzola/zola

Bug Report

Minor nitpick, this isn't breaking anything, but would be ideal if livereload.js returned with content type set to application/javascript.

Document 2019-04-18 00-49-53

I tried poking around in serve.rs but unfortunately I've only just begun learning Rust so wasn't quite sure how to patch this.

Environment

macOS Mojave 10.14.4

Zola version:

0.6.0

Expected Behavior

Content-Type: application/javascript; charset=UTF-8

Current Behavior

content-type: text/plain; charset=utf-8

Step to reproduce

Open the Network tab in Firefox or Chrome and check the content-type returned for livereload.js.

done

Most helpful comment

Thanks, fixed in the commit above!

All 4 comments

Thanks, fixed in the commit above!

Nice! FYI though I think text/javascript is deprecated in favor of application/javascript: https://tools.ietf.org/html/rfc4329#section-7.1

Nice! FYI though I think text/javascript is deprecated in favor of application/javascript: https://tools.ietf.org/html/rfc4329#section-7.1

Not really.

Wow, fascinating, the HTML spec "willfully violates" the obsoletion, LOL:

Similarly, the MIME type used to refer to JavaScript in this specification is text/javascript, since that is the most commonly used type, despite it being an officially obsoleted type according to RFC 4329. [[RFC4329](https://html.spec.whatwg.org/#refsRFC4329)]

https://html.spec.whatwg.org/#dependencies

Was this page helpful?
0 / 5 - 0 ratings