Skip to content

Commit

Permalink
Added user-agent check to post-unpublished
Browse files Browse the repository at this point in the history
  • Loading branch information
aileen committed Jun 26, 2023
1 parent efa7a03 commit 5d88157
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/algolia-netlify/functions/post-unpublished.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ exports.handler = async (event) => {
};
}

if (!event.headers['user-agent'].includes('https://github.com/TryGhost/Ghost')) {
return {
statusCode: 401,
body: `Unauthorized`
};
}

const algoliaSettings = {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
Expand Down

0 comments on commit 5d88157

Please sign in to comment.