mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
add http timeout example
This commit is contained in:
@@ -209,10 +209,12 @@ func WithKeepAlive(keepAliveDur time.Duration) Configurator {
|
||||
}
|
||||
|
||||
// WithTimeout sets the `Configuration.Timeout` field to the given duration.
|
||||
func WithTimeout(timeoutDur time.Duration, htmlBody string) Configurator {
|
||||
func WithTimeout(timeoutDur time.Duration, htmlBody ...string) Configurator {
|
||||
return func(app *Application) {
|
||||
app.config.Timeout = timeoutDur
|
||||
app.config.TimeoutMessage = htmlBody
|
||||
if len(htmlBody) > 0 {
|
||||
app.config.TimeoutMessage = htmlBody[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user