loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix bug in Wrap (#15302)

Whilst doing other work I have noticed that there is an issue with Wrap when passing an
http.Handler - the next should be the next handler in line not empty.

Signed-off-by: Andrew Thornton <art27@cantab.net>

authored by

zeripath and committed by
GitHub
b101fa83 5f184040

+4 -3
+4 -3
modules/web/route.go
··· 68 68 } 69 69 case func(http.Handler) http.Handler: 70 70 var next = http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}) 71 + if len(handlers) > i+1 { 72 + next = Wrap(handlers[i+1:]...) 73 + } 71 74 t(next).ServeHTTP(resp, req) 72 - if r, ok := resp.(context.ResponseWriter); ok && r.Status() > 0 { 73 - return 74 - } 75 + return 75 76 default: 76 77 panic(fmt.Sprintf("Unsupported handler type: %#v", t)) 77 78 }