Rename Handler to Responder

This commit is contained in:
Adnan Maolood
2020-10-21 16:28:50 -04:00
parent 53326e59a0
commit aeff8a051c
4 changed files with 101 additions and 107 deletions

4
fs.go
View File

@@ -16,7 +16,7 @@ func init() {
// FileServer takes a filesystem and returns a Handler which uses that filesystem.
// The returned Handler sanitizes paths before handling them.
func FileServer(fsys FS) Handler {
func FileServer(fsys FS) Responder {
return fsHandler{fsys}
}
@@ -24,7 +24,7 @@ type fsHandler struct {
FS
}
func (fsh fsHandler) Serve(w *ResponseWriter, r *Request) {
func (fsh fsHandler) Respond(w *ResponseWriter, r *Request) {
path := path.Clean(r.URL.Path)
f, err := fsh.Open(path)
if err != nil {