From 5ff899d5ac4aa3558acb30dba8ba6fd93586cb62 Mon Sep 17 00:00:00 2001
From: wxiaoguang <wxiaoguang@gmail.com>
Date: Sat, 22 Jan 2022 23:05:22 +0800
Subject: [PATCH] Fix route wrap (#18360)

---
 modules/web/wrap_convert.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/web/wrap_convert.go b/modules/web/wrap_convert.go
index d4a24b3ad4..8dc4e6d62b 100644
--- a/modules/web/wrap_convert.go
+++ b/modules/web/wrap_convert.go
@@ -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: