Skip to content

Commit 574dbbb

Browse files
committed
Add back in all the publish tests
1 parent 4d5b0bb commit 574dbbb

File tree

5 files changed

+1275
-2
lines changed

5 files changed

+1275
-2
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/montanaflynn/stats v0.7.1 // indirect
2020
github.com/pmezard/go-difflib v1.0.0 // indirect
2121
github.com/rogpeppe/go-internal v1.11.0 // indirect
22+
github.com/stretchr/objx v0.5.2 // indirect
2223
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
2324
github.com/xdg-go/scram v1.1.2 // indirect
2425
github.com/xdg-go/stringprep v1.0.4 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
2828
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
2929
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
3030
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
31+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
32+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
3133
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3234
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
3335
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=

internal/api/handlers/v0/publish.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func RegisterPublishEndpoint(api huma.API, registry service.RegistryService, aut
4242
}
4343

4444
const bearerPrefix = "Bearer "
45-
if len(authHeader) < len(bearerPrefix) || authHeader[:len(bearerPrefix)] != bearerPrefix {
45+
if len(authHeader) < len(bearerPrefix) || !strings.EqualFold(authHeader[:len(bearerPrefix)], bearerPrefix) {
4646
return nil, huma.Error401Unauthorized("Invalid Authorization header format. Expected 'Bearer <token>'")
4747
}
4848
token := authHeader[len(bearerPrefix):]
@@ -101,4 +101,4 @@ func RegisterPublishEndpoint(api huma.API, registry service.RegistryService, aut
101101
}
102102
return resp, nil
103103
})
104-
}
104+
}

0 commit comments

Comments
 (0)