We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3450a05 commit 245fd96Copy full SHA for 245fd96
internal/middleware/middleware.go
@@ -218,6 +218,13 @@ func RateLimiter(config types.PerformanceConfig) gin.HandlerFunc {
218
// Timeout creates a timeout middleware
219
func Timeout(timeout time.Duration) gin.HandlerFunc {
220
return func(c *gin.Context) {
221
+ acceptHeader := c.Request.Header.Get("Accept")
222
+ if strings.Contains(acceptHeader, "text/event-stream") ||
223
+ strings.Contains(acceptHeader, "application/x-ndjson") ||
224
+ c.Request.Header.Get("X-Accel-Buffering") == "no" {
225
+ c.Next()
226
+ return
227
+ }
228
ctx, cancel := context.WithTimeout(c.Request.Context(), timeout)
229
defer cancel()
230
0 commit comments