diff --git a/go.mod b/go.mod index 37a1590..5d18e8e 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/streamingfast/logging v0.0.0-20220304214715-bc750a74b424 github.com/streamingfast/sf-tracing v0.0.0-20240209202324-9daa52c71a52 github.com/stretchr/testify v1.11.1 - github.com/test-go/testify v1.1.4 go.uber.org/zap v1.21.0 google.golang.org/grpc v1.77.0 google.golang.org/protobuf v1.36.10 diff --git a/middleware/connect/authentication_test.go b/middleware/connect/authentication_test.go index 10bb444..0d611b2 100644 --- a/middleware/connect/authentication_test.go +++ b/middleware/connect/authentication_test.go @@ -3,11 +3,12 @@ package server import ( "context" "net/http" + "strings" "testing" "github.com/streamingfast/dauth" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/test-go/testify/assert" ) type testAuthenticators struct { @@ -22,7 +23,9 @@ func (t testAuthenticators) Ready(_ context.Context) bool { func (t testAuthenticators) Authenticate(ctx context.Context, path string, headers map[string][]string, ipAddress string) (context.Context, error) { out := make(dauth.TrustedHeaders) for key, values := range headers { - out[key] = values[0] + // Lower-case like real authenticators do, otherwise "X-SUBSTREAMS-Ll" and "x-substreams-ll" + // collide in [dauth.WithTrustedHeaders] and the winner depends on map iteration order. + out[strings.ToLower(key)] = values[0] } out["x-substreams-ll"] = "987" out["x-user-id"] = "a1b2c3"