aboutsummaryrefslogtreecommitdiff
path: root/mux.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-17 13:36:16 -0500
committerAdnan Maolood <[email protected]>2021-02-17 13:36:16 -0500
commit110c2de6de7b0a82b7ce60bb815a02b4bae80bca (patch)
treef1a41dc9166e9801be5f7894b739c417b240c671 /mux.go
parentstatus: Fix typo (diff)
downloadgo-gemini-110c2de6de7b0a82b7ce60bb815a02b4bae80bca.tar.xz
go-gemini-110c2de6de7b0a82b7ce60bb815a02b4bae80bca.zip
Redesign ResponseWriter interface
Diffstat (limited to 'mux.go')
-rw-r--r--mux.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/mux.go b/mux.go
index 80ddaa6..6073ba1 100644
--- a/mux.go
+++ b/mux.go
@@ -138,14 +138,14 @@ func (mux *ServeMux) ServeGemini(w ResponseWriter, r *Request) {
// If the given path is /tree and its handler is not registered,
// redirect for /tree/.
if u, ok := mux.redirectToPathSlash(path, r.URL); ok {
- w.Header(StatusRedirect, u.String())
+ w.WriteHeader(StatusRedirect, u.String())
return
}
if path != r.URL.Path {
u := *r.URL
u.Path = path
- w.Header(StatusRedirect, u.String())
+ w.WriteHeader(StatusRedirect, u.String())
return
}
@@ -154,7 +154,7 @@ func (mux *ServeMux) ServeGemini(w ResponseWriter, r *Request) {
resp := mux.match(path)
if resp == nil {
- w.Status(StatusNotFound)
+ w.WriteHeader(StatusNotFound, "Not found")
return
}
resp.ServeGemini(w, r)