From 99a7c9c274d81fb1e236e228b43cee8fda2d69a7 Mon Sep 17 00:00:00 2001 From: RyanDagg Date: Fri, 13 Oct 2023 15:17:07 -0600 Subject: [PATCH] fix: revert Request-Id case and check for lowercase as well. --- src/api-client.ts | 2 +- src/request-id.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index 3e042bf..615f517 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -100,7 +100,7 @@ export class APIClient { } static trackRequestIds(response: HTTP) { - const responseRequestIdHeader = response.headers[requestIdHeader] + const responseRequestIdHeader = response.headers[requestIdHeader] || response.headers[requestIdHeader.toLowerCase()] if (responseRequestIdHeader) { const requestIds = Array.isArray(responseRequestIdHeader) ? responseRequestIdHeader : responseRequestIdHeader.split(',') RequestId.track(...requestIds) diff --git a/src/request-id.ts b/src/request-id.ts index 8c6e5a3..26d9458 100644 --- a/src/request-id.ts +++ b/src/request-id.ts @@ -1,6 +1,6 @@ import * as uuid from 'uuid' -export const requestIdHeader = 'request-id' +export const requestIdHeader = 'Request-Id' // tslint:disable-next-line: no-unnecessary-class export class RequestId {