diff --git a/src/lib.rs b/src/lib.rs index 503f593..26a0af2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result { { Some(_) => { console_log!("event already published: {}", event.id); - return fetch(); + return empty_response(); } None => {} }; @@ -107,7 +107,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result { } } - fetch() + empty_response() }) .get("/", |_, ctx| { // For websocket compatibility @@ -195,7 +195,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result { }); Response::from_websocket(pair.client) }) - .options("/*catchall", |_, _| fetch()) + .options("/*catchall", |_, _| empty_response()) .run(req, env) .await } @@ -236,7 +236,7 @@ pub fn queue_number(batch_name: &str) -> Result { } } -fn fetch() -> worker::Result { +fn empty_response() -> worker::Result { Response::empty()?.with_cors(&cors()) }