Skip to content

Commit

Permalink
fix: revert Request-Id case and check for lowercase as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandagg committed Oct 13, 2023
1 parent fbe6246 commit 99a7c9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class APIClient {
}

static trackRequestIds<T>(response: HTTP<T>) {
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)
Expand Down
2 changes: 1 addition & 1 deletion src/request-id.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 99a7c9c

Please sign in to comment.