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

Not serving JavaScript files with UTF-8 encoding correctly #55

Closed
shen-tian opened this issue Nov 7, 2016 · 3 comments
Closed

Not serving JavaScript files with UTF-8 encoding correctly #55

shen-tian opened this issue Nov 7, 2016 · 3 comments

Comments

@shen-tian
Copy link

shen-tian commented Nov 7, 2016

Not sure if it's boot-http issue or one of its dependencies, but it's not serving JavaScript files with non-ASCII chars correctly. When it tries to do so, with the required <meta charset="UTF-8"> in the HTML, it yields a Uncaught SyntaxError: Invalid or unexpected token error.

I've reproduced the issues here. Trivial example, using an untouched copy of plotly.js (which uses the greek letters for pi and epsilon as variable names) and a minimal HTML file. It servers correctly with Python's SimpleHTTPServer but not boot-http.

Seems it's similar to this issue with figwheel? I've had a look through the source, but couldn't determine where the issue is.

I came across this while working on a ClojureScript page using cljsjs/plotly.

@pandeiro
Copy link
Owner

pandeiro commented Nov 8, 2016

Thanks, @shen-tian. As discussed in Slack, it looks like a Jetty configuration issue. The instant workaround is using httpkit, which seems to default to serving content as UTF-8. I'll look into whether Jetty can be configured by boot-http to default to that charset, as well.

@kommen
Copy link
Contributor

kommen commented Feb 15, 2017

Ran into the same issue with plotlyjs, this PR fixes the issue for me: #62

@pandeiro
Copy link
Owner

Fixed in 0.8.2

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

No branches or pull requests

3 participants