mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-27 04:07:28 +00:00
Add error & subroute handlers; weakString; other minor handler changes
This commit is contained in:
parent
4a3a418156
commit
eb8625f774
10 changed files with 331 additions and 212 deletions
|
|
@ -65,7 +65,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
addHTTPVarsToReplacer(repl, r, w)
|
||||
|
||||
// build and execute the main handler chain
|
||||
stack := s.Routes.BuildCompositeRoute(w, r)
|
||||
stack := s.Routes.BuildCompositeRoute(r)
|
||||
stack = s.wrapPrimaryRoute(stack)
|
||||
err := s.executeCompositeRoute(w, r, stack)
|
||||
if err != nil {
|
||||
|
|
@ -85,7 +85,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if s.Errors != nil && len(s.Errors.Routes) > 0 {
|
||||
errStack := s.Errors.Routes.BuildCompositeRoute(w, r)
|
||||
errStack := s.Errors.Routes.BuildCompositeRoute(r)
|
||||
err := s.executeCompositeRoute(w, r, errStack)
|
||||
if err != nil {
|
||||
// TODO: what should we do if the error handler has an error?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue