Skip to content

Commit 0b64373

Browse files
authored
Merge pull request #241 from Fenny/master
v1.8.41
2 parents 9f2b087 + e384442 commit 0b64373

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

application.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)