Sapper: non-page route should not set content-type

Created on 29 Jan 2018  路  6Comments  路  Source: sveltejs/sapper

https://github.com/sveltejs/sapper/blob/master/lib/index.js#L200

... does not check for route type. by setting a default type of text/html, Sapper ends up overriding useful auto-checking of mime types by express, especially for download content.

All 6 comments

Hi @samhatchett! That's a very good point. That line of code you linked should possible be moved here instead?

looks right to me. mind if I open a PR?

I think that would make Rich a very happy man.

I think a similar change should also be made here. This forcing of js content-type is I believe the only thing stopping custom assets by webpack from working (extract-text-plugin for css or file-loader for font assets, for examples).

primary issue fixed via #111 - similar change from @jacobmischka not yet addressed.

The core issue here is fixed so I'll close this, but I've opened a new ticket (#116) for the related issue @jacobmischka found

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nolanlawson picture nolanlawson  路  4Comments

milosdjakovic picture milosdjakovic  路  3Comments

Rich-Harris picture Rich-Harris  路  4Comments

matt3224 picture matt3224  路  4Comments

antony picture antony  路  3Comments