mirror of
https://github.com/kataras/iris.git
synced 2026-05-14 18:13:49 +00:00
Update to v4.0.0-alpha.1
This commit is contained in:
11
http.go
11
http.go
@@ -13,8 +13,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/iris-contrib/errors"
|
||||
"github.com/iris-contrib/logger"
|
||||
"github.com/kataras/iris/config"
|
||||
"github.com/kataras/iris/logger"
|
||||
"github.com/kataras/iris/utils"
|
||||
"github.com/valyala/fasthttp"
|
||||
"github.com/valyala/fasthttp/fasthttpadaptor"
|
||||
@@ -262,6 +262,11 @@ func newServer(cfg config.Server) *Server {
|
||||
// prepare just prepares the listening addr
|
||||
func (s *Server) prepare() {
|
||||
s.Config.ListeningAddr = config.ServerParseAddr(s.Config.ListeningAddr)
|
||||
if s.Server != nil {
|
||||
s.Server.MaxRequestBodySize = s.Config.MaxRequestBodySize
|
||||
s.Server.ReadBufferSize = s.Config.ReadBufferSize
|
||||
s.Server.WriteBufferSize = s.Config.WriteBufferSize
|
||||
}
|
||||
}
|
||||
|
||||
// IsListening returns true if server is listening/started, otherwise false
|
||||
@@ -399,10 +404,6 @@ func (s *Server) Open(h fasthttp.RequestHandler) error {
|
||||
|
||||
s.prepare() // do it again for any case
|
||||
|
||||
s.Server.MaxRequestBodySize = s.Config.MaxRequestBodySize
|
||||
s.Server.ReadBufferSize = s.Config.ReadBufferSize
|
||||
s.Server.WriteBufferSize = s.Config.WriteBufferSize
|
||||
|
||||
if s.Config.RedirectTo != "" {
|
||||
// override the handler and redirect all requests to this addr
|
||||
s.Server.Handler = func(reqCtx *fasthttp.RequestCtx) {
|
||||
|
||||
Reference in New Issue
Block a user