summaryrefslogtreecommitdiff
path: root/src/pkg/http/response.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/http/response.go')
-rw-r--r--src/pkg/http/response.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pkg/http/response.go b/src/pkg/http/response.go
index 87ca7f1cd..28f002d9b 100644
--- a/src/pkg/http/response.go
+++ b/src/pkg/http/response.go
@@ -188,9 +188,13 @@ func (resp *Response) Write(w io.Writer) os.Error {
resp.RequestMethod = strings.ToUpper(resp.RequestMethod)
// Status line
- text, ok := statusText[resp.StatusCode]
- if !ok {
- text = "status code " + strconv.Itoa(resp.StatusCode)
+ text := resp.Status
+ if text == "" {
+ var ok bool
+ text, ok = statusText[resp.StatusCode]
+ if !ok {
+ text = "status code " + strconv.Itoa(resp.StatusCode)
+ }
}
io.WriteString(w, "HTTP/"+strconv.Itoa(resp.ProtoMajor)+".")
io.WriteString(w, strconv.Itoa(resp.ProtoMinor)+" ")