Skip to content

Commit

Permalink
FIX - Add check to public address of the application when checking if…
Browse files Browse the repository at this point in the history
… the client is GitHub
  • Loading branch information
Juansecu committed Feb 25, 2024
1 parent ed25533 commit 1243425
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middlewares/check-whether-client-is-github.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export function checkIfClientIsGitHub(
if (process.env.NODE_ENV === 'production') {
consoleLogger.info(`Client host: ${request.get('host')}`);

if (request.get('host') !== 'api.github.com') {
if (
request.get('host') !== 'api.github.com' &&
request.get(process.env.PUBLIC_HOST_ADDRESS!)
) {
consoleLogger.error('Client is not GitHub');
response.status(403).send('Forbidden');
return;
Expand Down

0 comments on commit 1243425

Please sign in to comment.