diff --git a/rest/handler/tenanthandler.go b/rest/handler/tenanthandler.go index 312b4f6672fd..db363bb46306 100644 --- a/rest/handler/tenanthandler.go +++ b/rest/handler/tenanthandler.go @@ -11,7 +11,7 @@ func TenantHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() // add tenant to context - if tenantId := r.Header.Get("Tenant-ID"); tenantId == "" { + if tenantId := r.Header.Get("Tenant-Id"); tenantId == "" { ctx = context.WithValue(ctx, "tenant-id", "default") ctx = metadata.AppendToOutgoingContext(ctx, "tenant-id", "default") } else { diff --git a/rest/handler/tenanthandler_test.go b/rest/handler/tenanthandler_test.go index e6ba6ed13962..c9b0bbbb5102 100644 --- a/rest/handler/tenanthandler_test.go +++ b/rest/handler/tenanthandler_test.go @@ -11,11 +11,11 @@ import ( func TestTenantHandler(t *testing.T) { req := httptest.NewRequest(http.MethodGet, "http://localhost", http.NoBody) - req.Header.Set("Tenant-ID", "tenant-1") + req.Header.Set("Tenant-Id", "tenant-1") handler := TenantHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() // add tenant to context - if tenantId := r.Header.Get("Tenant-ID"); tenantId == "" { + if tenantId := r.Header.Get("Tenant-Id"); tenantId == "" { ctx = context.WithValue(ctx, "tenant-id", "default") ctx = metadata.AppendToOutgoingContext(ctx, "tenant-id", "default") } else { @@ -36,7 +36,7 @@ func TestTenantHandlerByDefault(t *testing.T) { handler := TenantHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() // add tenant to context - if tenantId := r.Header.Get("Tenant-ID"); tenantId == "" { + if tenantId := r.Header.Get("Tenant-Id"); tenantId == "" { ctx = context.WithValue(ctx, "tenant-id", "default") ctx = metadata.AppendToOutgoingContext(ctx, "tenant-id", "default") } else {