Skip to content

Commit d7cc50e

Browse files
committed
fix: simplify flush
1 parent 72a1ae5 commit d7cc50e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

coderd/httpapi/httpapi_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ func TestWebsocketCloseMsg(t *testing.T) {
163163
// but it must also implement http.Hijack
164164
type mockWsResponseWriter struct {
165165
recorder http.ResponseWriter
166-
serverConn net.Conn
167166
clientConn net.Conn
167+
serverConn net.Conn
168168
serverReadWriter *bufio.ReadWriter
169169
}
170170

@@ -173,9 +173,7 @@ func (m mockWsResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
173173
}
174174

175175
func (m mockWsResponseWriter) Flush() {
176-
if f, ok := m.recorder.(http.Flusher); ok {
177-
f.Flush()
178-
}
176+
_ = m.serverReadWriter.Flush()
179177
}
180178

181179
func (m mockWsResponseWriter) Header() http.Header {

0 commit comments

Comments
 (0)