Skip to content

Commit

Permalink
lockdown endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cultpodcasts committed Mar 6, 2024
1 parent b804805 commit eac1fde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface Env {
DB: D1Database;
apikey: string;
apihost: string;
gatewayKey: string;
}

export default {
Expand Down Expand Up @@ -151,7 +152,7 @@ export default {
return new Response(JSON.stringify({ error: "Unable to accept" }), { headers, status: 400 });
}
});
} else if (request.method === "GET") {
} else if (request.method === "GET" && request.headers.get("key") === env.gatewayKey) {
let submissionIds = env.DB
.prepare("SELECT id FROM urls WHERE state=0");
let result = await submissionIds.all();
Expand Down

0 comments on commit eac1fde

Please sign in to comment.