]> source.dussan.org Git - gitea.git/commitdiff
Fix route wrap (#18360)
authorwxiaoguang <wxiaoguang@gmail.com>
Sat, 22 Jan 2022 15:05:22 +0000 (23:05 +0800)
committerGitHub <noreply@github.com>
Sat, 22 Jan 2022 15:05:22 +0000 (15:05 +0000)
modules/web/wrap_convert.go

index d4a24b3ad4dfdc2540b20166fb893ce0349b2a16..8dc4e6d62bd8a80d233541549f3e5da697030661 100644 (file)
@@ -93,6 +93,9 @@ func convertHandler(handler interface{}) wrappedHandlerFunc {
                        }
                        routing.UpdateFuncInfo(req.Context(), funcInfo)
                        t(next).ServeHTTP(resp, req)
+                       if r, ok := resp.(context.ResponseWriter); ok && r.Status() > 0 {
+                               done = true
+                       }
                        return
                }
        default: