Skip to content

Commit

Permalink
support multipart content-type strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-mccoy committed Apr 26, 2023
1 parent 1acef31 commit 84994c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function fetch<T>(url: URL | RequestInfo, init?: RequestInit) {

if (resp.ok) {
// Parse the response as JSON if the content type is JSON
if (contentType === "application/json") {
if (contentType.includes("application/json")) {
data = await resp.json();
} else {
// Otherwise, return however the response was read
Expand Down

0 comments on commit 84994c6

Please sign in to comment.