7
7
"github.com/bufbuild/connect-go"
8
8
)
9
9
10
- const XDefangOrgID = "x-defang-orgid "
10
+ const XDefangOrgID = "X-Defang-Orgid "
11
11
12
12
type authInterceptor struct {
13
13
authorization string
@@ -20,8 +20,8 @@ func NewAuthInterceptor(token, orgID string) connect.Interceptor {
20
20
21
21
func (a * authInterceptor ) WrapUnary (next connect.UnaryFunc ) connect.UnaryFunc {
22
22
return func (ctx context.Context , req connect.AnyRequest ) (connect.AnyResponse , error ) {
23
- req .Header ().Set ("authorization " , a .authorization )
24
- req .Header ().Set ("content-type " , "application/grpc" ) // same as the gRPC client
23
+ req .Header ().Set ("Authorization " , a .authorization )
24
+ req .Header ().Set ("Content-Type " , "application/grpc" ) // same as the gRPC client
25
25
req .Header ().Set (XDefangOrgID , a .orgID )
26
26
return next (ctx , req )
27
27
}
@@ -30,8 +30,8 @@ func (a *authInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
30
30
func (a * authInterceptor ) WrapStreamingClient (next connect.StreamingClientFunc ) connect.StreamingClientFunc {
31
31
return func (ctx context.Context , spec connect.Spec ) connect.StreamingClientConn {
32
32
conn := next (ctx , spec )
33
- conn .RequestHeader ().Set ("authorization " , a .authorization )
34
- conn .RequestHeader ().Set ("content-type " , "application/grpc" ) // same as the gRPC client
33
+ conn .RequestHeader ().Set ("Authorization " , a .authorization )
34
+ conn .RequestHeader ().Set ("Content-Type " , "application/grpc" ) // same as the gRPC client
35
35
conn .RequestHeader ().Set (XDefangOrgID , a .orgID )
36
36
return conn
37
37
}
0 commit comments