kataras / kataras/iris

TimeoutHandler

Open
#1,751 8 comments 0 reactions 0 assignees View on GitHub
🤔 type:question
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

@kataras hi, is there a way to do in `iris` like this in `net/http`?
```golang
func TimeoutHandler(duration time.Duration) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
if duration > 0 {
return http.TimeoutHandler(next, duration, reason)
}

return next
}
}
i want to set a http timeout, and get `503` code

```

_Originally posted by @sado0823 in https://github.com/kataras/iris/issues/1668#issuecomment-814874372_

Contributor guide

Open the contributing guide

Research direction

No Iris file or test is named. Start by reviewing the framework's HTTP middleware support and the referenced net/http.TimeoutHandler behavior; done should establish whether Iris can apply a request timeout and return HTTP 503, with the behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.