mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-02 10:52:49 +02:00
internal/httputil: add request id to error page (#144)
This commit is contained in:
parent
3d6471c4b3
commit
f68338c888
7 changed files with 31 additions and 29 deletions
33
internal/log/wrap_writer_test.go
Normal file
33
internal/log/wrap_writer_test.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package log // import "github.com/pomerium/pomerium/internal/log"
|
||||
|
||||
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