Refactor: Middleware chain uses Handler instead of HandlerFunc

This commit is contained in:
Matthew Holt
2015-04-02 23:30:54 -06:00
parent db2cd9e941
commit d33256f1dc
15 changed files with 80 additions and 71 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import (
// Headers is middleware that adds headers to the responses
// for requests matching a certain path.
type Headers struct {
Next middleware.HandlerFunc
Next middleware.Handler
Rules []HeaderRule
}
@@ -26,7 +26,7 @@ func (h Headers) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
}
}
}
return h.Next(w, r)
return h.Next.ServeHTTP(w, r)
}
type (