Fix Unicode encoding errors (#2)
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ import (
|
|||||||
// W3C Working Draft 29 October 2009
|
// W3C Working Draft 29 October 2009
|
||||||
// http://www.w3.org/TR/2009/WD-eventsource-20091029/
|
// 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 contentType = []string{ContentType}
|
||||||
var noCache = []string{"no-cache"}
|
var noCache = []string{"no-cache"}
|
||||||
|
|||||||
+1
-1
@@ -198,7 +198,7 @@ func TestRenderSSE(t *testing.T) {
|
|||||||
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, w.Body.String(), "event:msg\ndata:hi! how are you?\n\n")
|
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")
|
assert.Equal(t, w.Header().Get("Cache-Control"), "no-cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user