2
0

Fix Unicode encoding errors (#2)

This commit is contained in:
leonlau
2022-04-04 19:19:04 +08:00
committed by GitHub
parent ea4ee031b4
commit 4ac659647a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ import (
// W3C Working Draft 29 October 2009
// http://www.w3.org/TR/2009/WD-eventsource-20091029/
const ContentType = "text/event-stream"
const ContentType = "text/event-stream;charset=utf-8"
var contentType = []string{ContentType}
var noCache = []string{"no-cache"}
+1 -1
View File
@@ -198,7 +198,7 @@ func TestRenderSSE(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, w.Body.String(), "event:msg\ndata:hi! how are you?\n\n")
assert.Equal(t, w.Header().Get("Content-Type"), "text/event-stream")
assert.Equal(t, w.Header().Get("Content-Type"), "text/event-stream;charset=utf-8")
assert.Equal(t, w.Header().Get("Cache-Control"), "no-cache")
}