@@ -53,9 +53,21 @@ type (
5353 // Folder containing template files
5454 TemplateFolder string `default:""`
5555 // Template engine: html, amber, handlebars , mustache or pug
56- TemplateEngine func (raw string , bind interface {}) (string , error ) `default:""`
56+ TemplateEngine func (raw string , bind interface {}) (string , error ) `default:"nil "`
5757 // Extension for the template files
5858 TemplateExtension string `default:""`
59+ // ReadTimeout is the amount of time allowed to read the full request including body.
60+ // The connection's read deadline is reset when the connection opens, or for
61+ // keep-alive connections after the first byte has been read.
62+ // Default timeout is unlimited.
63+ ReadTimeout time.Duration
64+ // WriteTimeout is the maximum duration before timing out writes of the response.
65+ // It is reset after the request handler has returned.
66+ // Default timeout is unlimited.
67+ WriteTimeout time.Duration
68+ // The maximum amount of time to wait for the next request when keep-alive is enabled.
69+ // If IdleTimeout is zero, the value of ReadTimeout is used.
70+ IdleTimeout time.Duration
5971 }
6072)
6173
@@ -503,6 +515,9 @@ func (app *App) newServer() *fasthttp.Server {
503515 Name : app .Settings .ServerHeader ,
504516 MaxRequestBodySize : app .Settings .BodyLimit ,
505517 NoDefaultServerHeader : app .Settings .ServerHeader == "" ,
518+ ReadTimeout : app .Settings .ReadTimeout ,
519+ WriteTimeout : app .Settings .WriteTimeout ,
520+ IdleTimeout : app .Settings .IdleTimeout ,
506521 Logger : & customLogger {},
507522 LogAllErrors : false ,
508523 ErrorHandler : func (ctx * fasthttp.RequestCtx , err error ) {
0 commit comments