Commit f1928917 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

httptest: default the Recorder status code to 200 on a Write

This matches the real ResponseWriter behavior.

R=rsc
CC=golang-dev
https://golang.org/cl/4291048
parent 5245b27e
......@@ -42,6 +42,9 @@ func (rw *ResponseRecorder) Write(buf []byte) (int, os.Error) {
if rw.Body != nil {
rw.Body.Write(buf)
}
if rw.Code == 0 {
rw.Code = http.StatusOK
}
return len(buf), nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment