mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
Update to 4.6.0, read HISTORY.md
https://github.com/kataras/iris/blob/master/HISTORY.md
This commit is contained in:
7
http.go
7
http.go
@@ -1173,7 +1173,7 @@ func (mux *serveMux) BuildHandler() HandlerFunc {
|
||||
if middleware != nil {
|
||||
// ok we found the correct route, serve it and exit entirely from here
|
||||
context.Params = params
|
||||
context.middleware = middleware
|
||||
context.Middleware = middleware
|
||||
//ctx.Request.Header.SetUserAgentBytes(DefaultUserAgent)
|
||||
context.Do()
|
||||
return
|
||||
@@ -1420,7 +1420,8 @@ func ParseScheme(domain string) string {
|
||||
return SchemeHTTP
|
||||
}
|
||||
|
||||
var proxyHandler = func(proxyAddr string, redirectSchemeAndHost string) fasthttp.RequestHandler {
|
||||
// ProxyHandler returns a new fasthttp handler which works as 'proxy', maybe doesn't suits you look its code before using that in production
|
||||
var ProxyHandler = func(proxyAddr string, redirectSchemeAndHost string) fasthttp.RequestHandler {
|
||||
return func(reqCtx *fasthttp.RequestCtx) {
|
||||
// override the handler and redirect all requests to this addr
|
||||
redirectTo := redirectSchemeAndHost
|
||||
@@ -1458,7 +1459,7 @@ func Proxy(proxyAddr string, redirectSchemeAndHost string) func() error {
|
||||
proxyAddr = ParseHost(proxyAddr)
|
||||
|
||||
// override the handler and redirect all requests to this addr
|
||||
h := proxyHandler(proxyAddr, redirectSchemeAndHost)
|
||||
h := ProxyHandler(proxyAddr, redirectSchemeAndHost)
|
||||
prx := New(OptionDisableBanner(true))
|
||||
prx.Router = h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user