Skip to content

Commit

Permalink
qualify webhook update with post
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Jul 11, 2024
1 parent 4bf2504 commit 9d93550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/mastercomfig-cf-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ async function handleRequest(request) {
let resBody = constructDataResponse(updated, version, v);
return new Response(resBody, generateCommonHeaders(origin, resHeaders));
}
if (url.pathname !== "/" && authenticate(url.pathname, webhookPathname)) {
if (
request.method == "POST" &&
url.pathname !== "/" &&
authenticate(url.pathname, webhookPathname)
) {
await forceUpdate(version);
}
const resBody = await getApiData(version);
Expand Down

0 comments on commit 9d93550

Please sign in to comment.