Skip to content

Commit 80d523f

Browse files
committed
fixing #21 - bad only handling JSON bodies now
1 parent 11e20df commit 80d523f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ function parseBody(
8989
contentType: string | undefined,
9090
): object | string {
9191
if (body) {
92-
if (contentType === 'application/json' && typeof body === 'string') {
93-
return JSON.parse(body);
94-
}
95-
if (contentType === 'text/plain') {
92+
if (contentType === 'application/json') {
93+
if (typeof body === 'string') {
94+
return JSON.parse(body);
95+
}
9696
return body;
9797
}
9898
}

0 commit comments

Comments
 (0)