diff --git a/internal/entrypoint/README.md b/internal/entrypoint/README.md index c83159b9..8449c079 100644 --- a/internal/entrypoint/README.md +++ b/internal/entrypoint/README.md @@ -377,7 +377,7 @@ Routes can access the entrypoint from request context: ```go // Set entrypoint in context -entrypoint.SetCtx(r.Context(), ep) +entrypoint.SetCtx(task, ep) // Get entrypoint from context if ep := entrypoint.FromCtx(r.Context()); ep != nil { diff --git a/internal/net/gphttp/middleware/bypass_test.go b/internal/net/gphttp/middleware/bypass_test.go index 89a2d47b..5c2afb2b 100644 --- a/internal/net/gphttp/middleware/bypass_test.go +++ b/internal/net/gphttp/middleware/bypass_test.go @@ -230,7 +230,6 @@ func TestEntrypointBypassRoute(t *testing.T) { portInt, err := strconv.Atoi(port) expect.NoError(t, err) - expect.NoError(t, err) entry := entrypoint.NewTestEntrypoint(t, nil) _, err = route.NewStartedTestRoute(t, &route.Route{ Alias: "test-route", diff --git a/internal/route/route_test.go b/internal/route/route_test.go index 77c65a57..500e40c4 100644 --- a/internal/route/route_test.go +++ b/internal/route/route_test.go @@ -212,9 +212,9 @@ func TestRouteBindField(t *testing.T) { t.Run("HTTPSchemeWithoutBind", func(t *testing.T) { r := &Route{ Alias: "test-http", - Scheme: route.SchemeHTTPS, + Scheme: route.SchemeHTTP, Host: "example.com", - Port: route.Port{Proxy: 443}, + Port: route.Port{Proxy: 80}, } err := r.Validate() require.NoError(t, err, "Validate should not return error for HTTP route with bind") @@ -225,9 +225,9 @@ func TestRouteBindField(t *testing.T) { t.Run("HTTPSchemeWithBind", func(t *testing.T) { r := &Route{ Alias: "test-http", - Scheme: route.SchemeHTTPS, + Scheme: route.SchemeHTTP, Host: "example.com", - Port: route.Port{Proxy: 443}, + Port: route.Port{Proxy: 80}, Bind: "0.0.0.0", } err := r.Validate() @@ -239,15 +239,15 @@ func TestRouteBindField(t *testing.T) { t.Run("HTTPSchemeWithBindAndPort", func(t *testing.T) { r := &Route{ Alias: "test-http", - Scheme: route.SchemeHTTPS, + Scheme: route.SchemeHTTP, Host: "example.com", - Port: route.Port{Listening: 8443, Proxy: 443}, + Port: route.Port{Listening: 8080, Proxy: 80}, Bind: "0.0.0.0", } err := r.Validate() require.NoError(t, err, "Validate should not return error for HTTP route with bind and port") require.NotNil(t, r.LisURL, "LisURL should be set") - require.Equal(t, "https://0.0.0.0:8443", r.LisURL.String(), "LisURL should contain bind address and listening port") + require.Equal(t, "https://0.0.0.0:8080", r.LisURL.String(), "LisURL should contain bind address and listening port") }) t.Run("TCPSchemeDefaultsToZeroBind", func(t *testing.T) { diff --git a/internal/route/stream/README.md b/internal/route/stream/README.md index 2b1a3909..67e4544f 100644 --- a/internal/route/stream/README.md +++ b/internal/route/stream/README.md @@ -63,10 +63,9 @@ func NewUDPUDPStream(network, listenAddr, dstAddr string) (nettypes.Stream, erro ```go type Stream interface { - ListenAndServe(ctx context.Context, preDial, onRead HookFunc) + ListenAndServe(ctx context.Context, preDial, onRead HookFunc) error Close() error LocalAddr() net.Addr - zerolog.LogObjectMarshaler } type HookFunc func(ctx context.Context) error