Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default mime type text/html for SPA #166

Merged
merged 1 commit into from
Apr 19, 2017
Merged

default mime type text/html for SPA #166

merged 1 commit into from
Apr 19, 2017

Conversation

JamesKyburz
Copy link
Contributor

When refreshing a page in a SPA the page source is returned as text/plain.

This PR changes the content type to text/html if the single flag is set.

@leo
Copy link
Contributor

leo commented Apr 19, 2017

Why? What about the JS and CSS assets and vectors, etc.? Aren't they better suited with text/plain than with text/html?

@JamesKyburz
Copy link
Contributor Author

JamesKyburz commented Apr 19, 2017

The assets are returned with the correct mime types. This is because the mime module uses their extensions.

The problem is when the url has no extension, so for example a url in a SPA with /awesome/cats would return text/plain and the html source. In a SPA the default page is index.html.

The problem only occurs if the page is refreshed.

@leo leo merged commit 5967c22 into vercel:master Apr 19, 2017
@leo
Copy link
Contributor

leo commented Apr 19, 2017

👌

@JamesKyburz
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants