Skip to content

Commit f40e7da

Browse files
authored
fix: call to the toString method when Response receives a String object (#239)
1 parent 6755075 commit f40e7da

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

kits/javascript/shims/types/response.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import httpStatus from "http-status";
99
// It contains different helpers
1010
class Response {
1111
constructor(body, options = {}) {
12-
this.body = body;
12+
// Process the body
13+
if (body instanceof String) {
14+
this.body = body.toString();
15+
} else {
16+
this.body = body;
17+
}
1318

1419
if (options.headers instanceof Headers) {
1520
this.headers = options.headers;
93 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)