We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e0ad88 commit 74e43baCopy full SHA for 74e43ba
instrumentation/net/http/otelhttp/wrap_test.go
@@ -35,3 +35,26 @@ func TestRespWriterFlush(t *testing.T) {
35
assert.Equal(t, http.StatusOK, rw.statusCode)
36
assert.True(t, rw.wroteHeader)
37
}
38
+
39
+type nonFlushableResponseWriter struct{}
40
41
+func (_ nonFlushableResponseWriter) Header() http.Header {
42
+ return http.Header{}
43
+}
44
45
+func (_ nonFlushableResponseWriter) Write([]byte) (int, error) {
46
+ return 0, nil
47
48
49
+func (_ nonFlushableResponseWriter) WriteHeader(int) {}
50
51
+func TestRespWriterFlushNoFlusher(t *testing.T) {
52
+ rw := &respWriterWrapper{
53
+ ResponseWriter: nonFlushableResponseWriter{},
54
+ record: func(int64) {},
55
+ }
56
57
+ rw.Flush()
58
+ assert.Equal(t, http.StatusOK, rw.statusCode)
59
+ assert.True(t, rw.wroteHeader)
60
0 commit comments