Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

non-page route should not set content-type #109

Closed
samhatchett opened this issue Jan 29, 2018 · 6 comments
Closed

non-page route should not set content-type #109

samhatchett opened this issue Jan 29, 2018 · 6 comments

Comments

@samhatchett
Copy link
Contributor

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.

@EmilTholin
Copy link
Member

EmilTholin commented Jan 31, 2018

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

@samhatchett
Copy link
Contributor Author

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

@EmilTholin
Copy link
Member

I think that would make Rich a very happy man.

@jacobmischka
Copy link

jacobmischka commented Feb 1, 2018

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).

@samhatchett
Copy link
Contributor Author

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

@Rich-Harris
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants