mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-21 06:13:48 +00:00
test: add inbound route tests covering IP auth, validation, and R2 upload
This commit is contained in:
@@ -14,7 +14,13 @@ export async function handle(c: Context): Promise<Response> {
|
||||
contentType: payload.html ? "HTML" : "Text",
|
||||
});
|
||||
|
||||
return handleForwardEmail(payload, env, c.executionCtx);
|
||||
let ctx: ExecutionContext | undefined;
|
||||
try {
|
||||
ctx = c.executionCtx;
|
||||
} catch {
|
||||
// No ExecutionContext in this environment (e.g. tests); WebSub notifications will be skipped
|
||||
}
|
||||
return handleForwardEmail(payload, env, ctx);
|
||||
} catch (error) {
|
||||
console.error("Error processing email:", error);
|
||||
return new Response("Error processing email", { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user