fix: timeout not working if greater than global rest timeout (#2926)
This commit is contained in:
@@ -43,6 +43,7 @@ Verbose: true
|
||||
Path: "/",
|
||||
Handler: func(w http.ResponseWriter, r *http.Request) {},
|
||||
}},
|
||||
timeout: time.Minute,
|
||||
},
|
||||
{
|
||||
priority: true,
|
||||
@@ -53,6 +54,7 @@ Verbose: true
|
||||
Path: "/",
|
||||
Handler: func(w http.ResponseWriter, r *http.Request) {},
|
||||
}},
|
||||
timeout: time.Second,
|
||||
},
|
||||
{
|
||||
priority: true,
|
||||
@@ -159,6 +161,11 @@ Verbose: true
|
||||
}
|
||||
})
|
||||
assert.NotNil(t, ng.start(mockedRouter{}))
|
||||
timeout := time.Second * 3
|
||||
if route.timeout > timeout {
|
||||
timeout = route.timeout
|
||||
}
|
||||
assert.Equal(t, timeout, ng.timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user