Skip to content

Commit 01ad7a7

Browse files
committed
change tenant header convention
1 parent 4fc698b commit 01ad7a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/tenant/grpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
const (
2121
// headerKeyTenantID is the header key for the tenant ID.
22-
headerKeyTenantID = "X-Tenant-ID"
22+
headerKeyTenantID = "X-Sourcegraph-Tenant-ID"
2323

2424
// headerValueNoTenant indicates the request has no tenant.
2525
headerValueNoTenant = "none"

internal/tenant/rest_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
func InjectTenantFromHeader(ctx context.Context, header http.Header) (context.Context, error) {
1515
log.Printf("header: %v", header)
16-
tenantID := header.Get(headerKeyTenantID)
16+
tenantID := header.Get("X-TENANT-ID") // TODO: we don't use headerKeyTenantID here so we don't need to change it and potentially break future grpc changes
1717
log.Printf("tenantID: %s", tenantID)
1818
if tenantID != "" {
1919
tenant, err := tenanttype.Unmarshal(tenantID)

0 commit comments

Comments
 (0)