Skip to content

Commit

Permalink
Add preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Dec 1, 2023
1 parent b49dc6f commit b43c139
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arb-gateway/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Env {
L2_ROLLUP: string;
}

const {corsify} = createCors()
const {corsify, preflight} = createCors()
let app: Router;
async function fetch(request: Request, env: Env) {
// Loading libraries dynamically as a temp work around.
Expand All @@ -33,6 +33,7 @@ async function fetch(request: Request, env: Env) {
const server = new Server();
gateway.add(server);
app = server.makeApp('/');
app.all('*', preflight);
}
return app.handle(request).then(corsify);
}
Expand Down

0 comments on commit b43c139

Please sign in to comment.