aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-01-10 00:10:57 -0500
committerAdnan Maolood <[email protected]>2021-01-10 00:10:57 -0500
commit3ed39e62d8952391287bd4ebf54a4893e3e6411b (patch)
tree8c44fa8d5934340e425809981a2a7954ebf9c7f0 /server.go
parentAdd missing error handling (diff)
downloadgo-gemini-3ed39e62d8952391287bd4ebf54a4893e3e6411b.tar.xz
go-gemini-3ed39e62d8952391287bd4ebf54a4893e3e6411b.zip
Rename status.Message to status.Meta
Diffstat (limited to 'server.go')
-rw-r--r--server.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/server.go b/server.go
index 8d09382..ecfd62d 100644
--- a/server.go
+++ b/server.go
@@ -266,15 +266,10 @@ func (w *ResponseWriter) Header(status Status, meta string) {
// Status sets the response header to the given status code.
//
-// Status is equivalent to Header(status, status.Message())
+// Status is equivalent to Header(status, status.Meta())
func (w *ResponseWriter) Status(status Status) {
- meta := status.Message()
-
- if status.Class() == StatusClassSuccess {
- meta = w.mediatype
- }
-
- w.Header(status, meta)
+ w.status = status
+ w.meta = status.Meta()
}
// SetMediaType sets the media type that will be written for a successful response.