1
0

Added support for more json type headers

This commit is contained in:
2021-06-13 12:34:41 +02:00
parent 038219310b
commit d63bdcbaab
2 changed files with 2 additions and 2 deletions

View File

@@ -349,7 +349,7 @@ class Router {
})
}
const headers = Object.assign({ 'Content-Type': 'application/json' }, response.headers)
if (headers['Content-Type'] === 'application/json' && typeof response.body === 'object')
if (headers['Content-Type'].includes('json') && typeof response.body === 'object')
response.body = JSON.stringify(response.body)
return new Response(response.body, {
status: response.status || (response.body ? 200 : 500),