Skip to content

Commit

Permalink
fix: fix beforeMiddleware for support request by @prisma/client/edge
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed Jun 15, 2022
1 parent 2854c5f commit 3010d26
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/middlewares/beforeMiddleware.ts
Expand Up @@ -4,8 +4,7 @@ export const beforeMiddleware =
({ apiKey }: { apiKey: string }) =>
(req: Request, res: Response, next: NextFunction) => {
// support request by @prisma/client/edge
if (req.method === "POST" && !req.headers["content-type"])
req.headers["content-type"] = "application/json";
if (req.method === "POST") req.headers["content-type"] = "application/json";

// auth check
const token = req.headers.authorization || "";
Expand Down

0 comments on commit 3010d26

Please sign in to comment.