mirror of
https://github.com/stretchr/testify.git
synced 2025-05-30 19:22:30 +00:00
Fixes #15 - writes 200 header if no specific header has been written
This commit is contained in:
parent
d6863491da
commit
9aa77ca769
@ -31,6 +31,11 @@ func (rw *TestResponseWriter) Header() http.Header {
|
||||
// Write writes the specified bytes to Output.
|
||||
func (rw *TestResponseWriter) Write(bytes []byte) (int, error) {
|
||||
|
||||
// assume 200 success if no header has been set
|
||||
if rw.WrittenHeaderInt == 0 {
|
||||
rw.WriteHeader(200)
|
||||
}
|
||||
|
||||
// add these bytes to the output string
|
||||
rw.Output = rw.Output + string(bytes)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user