@@ -53,9 +53,21 @@ type (
53
53
// Folder containing template files
54
54
TemplateFolder string `default:""`
55
55
// 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 "`
57
57
// Extension for the template files
58
58
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
59
71
}
60
72
)
61
73
@@ -503,6 +515,9 @@ func (app *App) newServer() *fasthttp.Server {
503
515
Name : app .Settings .ServerHeader ,
504
516
MaxRequestBodySize : app .Settings .BodyLimit ,
505
517
NoDefaultServerHeader : app .Settings .ServerHeader == "" ,
518
+ ReadTimeout : app .Settings .ReadTimeout ,
519
+ WriteTimeout : app .Settings .WriteTimeout ,
520
+ IdleTimeout : app .Settings .IdleTimeout ,
506
521
Logger : & customLogger {},
507
522
LogAllErrors : false ,
508
523
ErrorHandler : func (ctx * fasthttp.RequestCtx , err error ) {
0 commit comments