{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6230","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6230/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6230/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6230/events","html_url":"https://github.com/spring-projects/spring-boot/issues/6230","id":162336324,"number":6230,"title":"1.4.0.M3: SseEmitter, Jetty, CORS: Wrong charset in Content-Type header","user":{"login":"ralscha","id":372512,"avatar_url":"https://avatars.githubusercontent.com/u/372512?v=3","gravatar_id":"","url":"https://api.github.com/users/ralscha","html_url":"https://github.com/ralscha","followers_url":"https://api.github.com/users/ralscha/followers","following_url":"https://api.github.com/users/ralscha/following{/other_user}","gists_url":"https://api.github.com/users/ralscha/gists{/gist_id}","starred_url":"https://api.github.com/users/ralscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralscha/subscriptions","organizations_url":"https://api.github.com/users/ralscha/orgs","repos_url":"https://api.github.com/users/ralscha/repos","events_url":"https://api.github.com/users/ralscha/events{/privacy}","received_events_url":"https://api.github.com/users/ralscha/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/waiting-for-triage","name":"waiting-for-triage","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"assignees":[{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-06-26T16:52:11Z","updated_at":"2016-06-27T07:50:52Z","closed_at":null,"body":"There is a problem in 1.4.0.M3 and 1.4.0.BUILD-SNAPSHOT, Jetty, EventSource (SseEmitter) and CORS. With this setup spring boot sends a wrong Content-Type response header back to the client. \r\n`Content-Type: text/event-stream; charset=ISO-8859-1`\r\n\r\nChrome 51 complains with this error message\r\n`EventSource's response has a charset (\"iso-8859-1\") that is not UTF-8. Aborting the connection.`\r\n\r\nWhen the request is not sent with CORS the server sends this header\r\n`Content-Type: text/event-stream`\r\nwhich is okay for Chrome. Event streams must always be encoded using UTF-8\r\n\r\nHere is a github repository that demonstrates the problem:\r\nhttps://github.com/ralscha/sse-encoding\r\n\r\nRequests to http://localhost:8080 work fine but when you do a CORS request (for example by opening index.html directly from filesystem) Chrome will complain with the above-mentioned error message.\r\n\r\nThis problem does not occur with Spring Boot 1.4.0.M2\r\nand it does not occur with Tomcat and Undertow with 1.4.0.M3 and 1.4.0.BUILD-SNAPSHOT"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/228676294","html_url":"https://github.com/spring-projects/spring-boot/issues/6230#issuecomment-228676294","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6230","id":228676294,"user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T07:50:52Z","updated_at":"2016-06-27T07:50:52Z","body":"Thanks for the sample that reproduces the problem. The `ISO-8859-1` response can be reproduced with a simple curl request:\r\n\r\n```\r\ncurl -v localhost:8080/start -H 'Origin: foo'\r\n```"}}
{"actor":{"display_login":"wilkinsona"}}