mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
Relocate wrapped ResponseWriter to middleware
This commit is contained in:
parent
d3cb338a72
commit
78722ec36b
3 changed files with 4 additions and 3 deletions
33
internal/middleware/responsewriter/wrap_writer_test.go
Normal file
33
internal/middleware/responsewriter/wrap_writer_test.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package responsewriter
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFlushWriterRemembersWroteHeaderWhenFlushed(t *testing.T) {
|
||||
f := &flushWriter{basicWriter{ResponseWriter: httptest.NewRecorder()}}
|
||||
f.Flush()
|
||||
|
||||
if !f.wroteHeader {
|
||||
t.Fatal("want Flush to have set wroteHeader=true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHttpFancyWriterRemembersWroteHeaderWhenFlushed(t *testing.T) {
|
||||
f := &httpFancyWriter{basicWriter{ResponseWriter: httptest.NewRecorder()}}
|
||||
f.Flush()
|
||||
|
||||
if !f.wroteHeader {
|
||||
t.Fatal("want Flush to have set wroteHeader=true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHttp2FancyWriterRemembersWroteHeaderWhenFlushed(t *testing.T) {
|
||||
f := &http2FancyWriter{basicWriter{ResponseWriter: httptest.NewRecorder()}}
|
||||
f.Flush()
|
||||
|
||||
if !f.wroteHeader {
|
||||
t.Fatal("want Flush to have set wroteHeader=true")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue