Skip to content

Commit

Permalink
Merge pull request #62 from skip-mev/override-proxy-header
Browse files Browse the repository at this point in the history
override access-control-allow-origin on node proxy
  • Loading branch information
thal0x authored Oct 30, 2023
2 parents bcef602 + dd27f83 commit 97c5c3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/api/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ function proxyHandler(req: NextApiRequest, res: NextApiResponse) {

proxy.once("error", reject);

proxy.on("proxyRes", (proxyRes) => {
proxyRes.headers["access-control-allow-origin"] = "*";
});

proxy.web(req, res, {
target: rpcURL,
autoRewrite: false,
Expand Down

1 comment on commit 97c5c3a

@vercel
Copy link

@vercel vercel bot commented on 97c5c3a Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.