Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/content/docs/workers/examples/fetch-json.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default {
if (contentType.includes("application/json")) {
return { contentType, result: JSON.stringify(await response.json()) };
}
return { contentType, result: response.text() };

return { contentType, result: await response.text() };
}

const response = await fetch(url);
Expand All @@ -59,7 +60,7 @@ export default {
if (contentType.includes("application/json")) {
return { contentType, result: JSON.stringify(await response.json()) };
}
return { contentType, result: response.text() };
return { contentType, result: await response.text() };
}

const response = await fetch(url);
Expand Down
Loading