The ResponseWriters defined in rest.handler add Flush interface. (#318)

This commit is contained in:
jichangyun
2020-12-28 21:30:24 +08:00
committed by GitHub
parent 71a2b20301
commit 0bd2a0656c
8 changed files with 88 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ func TestAuthHandler(t *testing.T) {
w.Header().Set("X-Test", "test")
_, err := w.Write([]byte("content"))
assert.Nil(t, err)
flusher, ok := w.(http.Flusher)
assert.Equal(t, ok, true)
flusher.Flush()
}))
resp := httptest.NewRecorder()