Skip to content

Commit

Permalink
(fix): global headers case insensitive comparison (#4137)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Jul 29, 2024
1 parent 20d66b8 commit bd66253
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/openapi-ir-to-fern/src/buildGlobalHeaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HeaderWithCount {
/* 75% of endpoints must have header present, for it to be considered a global header*/
const GLOBAL_HEADER_PERCENTAGE_THRESHOLD = 0.75;

const HEADERS_TO_IGNORE = new Set(...["Authorization"]);
const HEADERS_TO_IGNORE = new Set(...["authorization"]);

export function buildGlobalHeaders(context: OpenApiIrConverterContext): void {
const predefinedGlobalHeaders: Record<string, GlobalHeader> = Object.fromEntries(
Expand Down Expand Up @@ -62,7 +62,7 @@ export function buildGlobalHeaders(context: OpenApiIrConverterContext): void {
const globalHeaders: Record<string, HeaderWithCount> = {};
for (const endpoint of context.ir.endpoints) {
for (const header of endpoint.headers) {
if (HEADERS_TO_IGNORE.has(header.name)) {
if (HEADERS_TO_IGNORE.has(header.name.toLowerCase())) {
continue;
}
let headerWithCount = globalHeaders[header.name];
Expand Down

0 comments on commit bd66253

Please sign in to comment.