1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

add Context#ResetRequest and core/handlerconv.FromStdWithNext updates the request for any incoming request changes - https://github.com/kataras/iris/issues/1180

Former-commit-id: 764bf26bcaa3b7bdae0a2bdbf3bf2b6f8c5c546e
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-02-02 04:49:58 +02:00
parent 7278bcd537
commit 2cdbe17bd5
3 changed files with 32 additions and 2 deletions

View File

@@ -75,6 +75,7 @@ func FromStd(handler interface{}) context.Handler {
func FromStdWithNext(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)) context.Handler {
return func(ctx context.Context) {
next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx.ResetRequest(r)
ctx.Next()
})