Fix issue when returning ReadableStreams and other strange responses
This commit is contained in:
committed by
GitHub
parent
ec9f99e132
commit
fa2e293dda
3
index.js
3
index.js
@@ -358,6 +358,9 @@ class Router {
|
|||||||
res.headers['Content-Type'] = 'application/json'
|
res.headers['Content-Type'] = 'application/json'
|
||||||
res.body = JSON.stringify(res.body)
|
res.body = JSON.stringify(res.body)
|
||||||
}
|
}
|
||||||
|
if(res.response){
|
||||||
|
return res.response
|
||||||
|
}
|
||||||
return new Response(res.body, {
|
return new Response(res.body, {
|
||||||
status: res.status || (res.body ? 200 : 204),
|
status: res.status || (res.body ? 200 : 204),
|
||||||
headers: res.headers
|
headers: res.headers
|
||||||
|
|||||||
Reference in New Issue
Block a user