Macaron: remove custom Request type (#37874)

* remove macaron.Request, use http.Request instead

* remove com dependency from bindings module

* fix another c.Req.Request
This commit is contained in:
Serge Zaitsev
2021-09-01 11:18:30 +02:00
committed by GitHub
parent 56f61001a8
commit c3ab2fdeb7
35 changed files with 1205 additions and 111 deletions
+2 -7
View File
@@ -24,11 +24,6 @@ import (
"strings"
)
// Request represents an HTTP request received by a server or to be sent by a client.
type Request struct {
*http.Request
}
// ContextInvoker is an inject.FastInvoker wrapper of func(ctx *Context).
type ContextInvoker func(ctx *Context)
@@ -46,7 +41,7 @@ type Context struct {
index int
*Router
Req Request
Req *http.Request
Resp ResponseWriter
params Params
template *template.Template
@@ -144,7 +139,7 @@ func (ctx *Context) Redirect(location string, status ...int) {
code = status[0]
}
http.Redirect(ctx.Resp, ctx.Req.Request, location, code)
http.Redirect(ctx.Resp, ctx.Req, location, code)
}
// MaxMemory is the maximum amount of memory to use when parsing a multipart form.