diff options
| author | Adnan Maolood <[email protected]> | 2021-02-17 13:36:16 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-17 13:36:16 -0500 |
| commit | 110c2de6de7b0a82b7ce60bb815a02b4bae80bca (patch) | |
| tree | f1a41dc9166e9801be5f7894b739c417b240c671 /mux.go | |
| parent | status: Fix typo (diff) | |
| download | go-gemini-110c2de6de7b0a82b7ce60bb815a02b4bae80bca.tar.xz go-gemini-110c2de6de7b0a82b7ce60bb815a02b4bae80bca.zip | |
Redesign ResponseWriter interface
Diffstat (limited to 'mux.go')
| -rw-r--r-- | mux.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |