Skip to content

Commit

Permalink
fix(fix-request-body): make sure the content-type exists (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
oufeng committed Apr 28, 2021
1 parent 34468a1 commit 6205977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/fix-request-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function fixRequestBody(proxyReq: ClientRequest, req: Request): void {
proxyReq.write(bodyData);
};

if (contentType.includes('application/json')) {
if (contentType && contentType.includes('application/json')) {
writeBody(JSON.stringify(req.body));
}

Expand Down

0 comments on commit 6205977

Please sign in to comment.