chore: optimize coding style and add unit tests (#3917)

This commit is contained in:
Kevin Wan
2024-02-17 15:50:07 +08:00
committed by GitHub
parent 28cb2c5804
commit 6be37ad533
2 changed files with 15 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ func TestTimeoutSSE(t *testing.T) {
handler.ServeHTTP(resp, req)
assert.Equal(t, http.StatusOK, resp.Code)
}
func TestTimeoutWebsocket(t *testing.T) {
timeoutHandler := TimeoutHandler(time.Millisecond)
handler := timeoutHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {