chore: update linter.
This commit is contained in:
parent
da1c9f48b7
commit
f54136b602
12 changed files with 63 additions and 8 deletions
|
@ -28,6 +28,7 @@ func TestShutdownHijacked(t *testing.T) {
|
|||
err = resp.Write(conn)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
|
||||
testShutdown(t, router)
|
||||
}
|
||||
|
||||
|
@ -37,6 +38,7 @@ func TestShutdownHTTP(t *testing.T) {
|
|||
rw.WriteHeader(http.StatusOK)
|
||||
time.Sleep(time.Second)
|
||||
}))
|
||||
|
||||
testShutdown(t, router)
|
||||
}
|
||||
|
||||
|
@ -61,6 +63,8 @@ func TestShutdownTCP(t *testing.T) {
|
|||
}
|
||||
|
||||
func testShutdown(t *testing.T, router *tcp.Router) {
|
||||
t.Helper()
|
||||
|
||||
epConfig := &static.EntryPointsTransport{}
|
||||
epConfig.SetDefaults()
|
||||
|
||||
|
|
|
@ -103,6 +103,8 @@ func TestShutdownUDPConn(t *testing.T) {
|
|||
// It fatals if the read blocks longer than timeout, which is useful to detect
|
||||
// regressions that would make a test wait forever.
|
||||
func requireEcho(t *testing.T, data string, conn io.ReadWriter, timeout time.Duration) {
|
||||
t.Helper()
|
||||
|
||||
_, err := conn.Write([]byte(data))
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
|
@ -696,12 +696,16 @@ func (w *websocketRequest) open() (*websocket.Conn, net.Conn, error) {
|
|||
}
|
||||
|
||||
func parseURI(t *testing.T, uri string) *url.URL {
|
||||
t.Helper()
|
||||
|
||||
out, err := url.ParseRequestURI(uri)
|
||||
require.NoError(t, err)
|
||||
return out
|
||||
}
|
||||
|
||||
func createProxyWithForwarder(t *testing.T, proxy http.Handler, url string) *httptest.Server {
|
||||
t.Helper()
|
||||
|
||||
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path // keep the original path
|
||||
// Set new backend URL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue