Skip to content

Commit

Permalink
fix: set content-type for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Oct 5, 2021
1 parent e751a60 commit bb374aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export async function loadSourceImage ({ cacheDir, url, requestEtag, modifiers,
return {
response: {
statusCode: GATEWAY_ERROR,
body: `Error loading source image: ${e.message}`
headers: {
'Content-Type': 'text/plain'
},
body: `Error loading source image: ${e.message} ${url}`
}
}
}
Expand Down Expand Up @@ -113,6 +116,9 @@ export async function loadSourceImage ({ cacheDir, url, requestEtag, modifiers,
return {
response: {
statusCode: GATEWAY_ERROR,
headers: {
'Content-Type': 'text/plain'
},
body: 'Source is not an image'
}
}
Expand Down

0 comments on commit bb374aa

Please sign in to comment.