From fa2e293dda14870d5bcc6ef2cd81646be86d4e5f Mon Sep 17 00:00:00 2001 From: Simon Blomsterlund Date: Sun, 7 Nov 2021 23:14:12 +0200 Subject: [PATCH] Fix issue when returning ReadableStreams and other strange responses --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3c10453..225022d 100644 --- a/index.js +++ b/index.js @@ -358,6 +358,9 @@ class Router { res.headers['Content-Type'] = 'application/json' res.body = JSON.stringify(res.body) } + if(res.response){ + return res.response + } return new Response(res.body, { status: res.status || (res.body ? 200 : 204), headers: res.headers @@ -369,4 +372,4 @@ class Router { } } -module.exports = Router \ No newline at end of file +module.exports = Router