Skip to content

Commit

Permalink
Made public API enpoints check case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
u-hubar committed Sep 22, 2023
1 parent f5ec4f9 commit 377bd72
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/service/auth-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ class AuthService {
return false;
}

return (
this._authConfig.publicOperations.includes(`v0/${operationName}`) ||
this._authConfig.publicOperations.includes(operationName)
);
const lowerCaseOperationName = operationName.toLowerCase();

return this._authConfig.publicOperations.some((publicOperation) => {
const lowerCasePublicOperation = publicOperation.toLowerCase();
return (
lowerCasePublicOperation === `v0/${lowerCaseOperationName}` ||
lowerCasePublicOperation === lowerCaseOperationName
);
});
}

/**
Expand Down

0 comments on commit 377bd72

Please sign in to comment.