summaryrefslogtreecommitdiff
path: root/src/pkg/http/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/http/status.go')
-rw-r--r--src/pkg/http/status.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/http/status.go b/src/pkg/http/status.go
index 82a66d7ad..b6e2d65c6 100644
--- a/src/pkg/http/status.go
+++ b/src/pkg/http/status.go
@@ -98,3 +98,9 @@ var statusText = map[int]string{
StatusGatewayTimeout: "Gateway Timeout",
StatusHTTPVersionNotSupported: "HTTP Version Not Supported",
}
+
+// StatusText returns a text for the HTTP status code. It returns the empty
+// string if the code is unknown.
+func StatusText(code int) string {
+ return statusText[code]
+}