@@ -45,18 +45,22 @@ describe("compileRouteHandler", () => {
4545 }
4646
4747 if (ctx.response == null) {
48- return new Response(undefined, {
49- status: ctx.set.status,
50- headers: ctx.set.headers,
51- })
48+ return (
49+ ctx.response = new Response(undefined, {
50+ status: ctx.set.status,
51+ headers: ctx.set.headers,
52+ })
53+ )
5254 }
5355
5456 const serialized = utils.smartSerialize(ctx.response);
5557 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
56- return new Response(serialized.value, {
57- status: ctx.set.status,
58- headers: ctx.set.headers,
59- })
58+ return (
59+ ctx.response = new Response(serialized.value, {
60+ status: ctx.set.status,
61+ headers: ctx.set.headers,
62+ })
63+ )
6064 }"
6165 ` ,
6266 ) ;
@@ -88,18 +92,22 @@ describe("compileRouteHandler", () => {
8892 }
8993
9094 if (ctx.response == null) {
91- return new Response(undefined, {
92- status: ctx.set.status,
93- headers: ctx.set.headers,
94- })
95+ return (
96+ ctx.response = new Response(undefined, {
97+ status: ctx.set.status,
98+ headers: ctx.set.headers,
99+ })
100+ )
95101 }
96102
97103 const serialized = utils.smartSerialize(ctx.response);
98104 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
99- return new Response(serialized.value, {
100- status: ctx.set.status,
101- headers: ctx.set.headers,
102- })
105+ return (
106+ ctx.response = new Response(serialized.value, {
107+ status: ctx.set.status,
108+ headers: ctx.set.headers,
109+ })
110+ )
103111 }"
104112 ` ,
105113 ) ;
@@ -137,18 +145,22 @@ describe("compileRouteHandler", () => {
137145 }
138146
139147 if (ctx.response == null) {
140- return new Response(undefined, {
141- status: ctx.set.status,
142- headers: ctx.set.headers,
143- })
148+ return (
149+ ctx.response = new Response(undefined, {
150+ status: ctx.set.status,
151+ headers: ctx.set.headers,
152+ })
153+ )
144154 }
145155
146156 const serialized = utils.smartSerialize(ctx.response);
147157 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
148- return new Response(serialized.value, {
149- status: ctx.set.status,
150- headers: ctx.set.headers,
151- })
158+ return (
159+ ctx.response = new Response(serialized.value, {
160+ status: ctx.set.status,
161+ headers: ctx.set.headers,
162+ })
163+ )
152164 }"
153165 ` ) ;
154166 } ) ;
@@ -185,18 +197,22 @@ describe("compileRouteHandler", () => {
185197 }
186198
187199 if (ctx.response == null) {
188- return new Response(undefined, {
189- status: ctx.set.status,
190- headers: ctx.set.headers,
191- })
200+ return (
201+ ctx.response = new Response(undefined, {
202+ status: ctx.set.status,
203+ headers: ctx.set.headers,
204+ })
205+ )
192206 }
193207
194208 const serialized = utils.smartSerialize(ctx.response);
195209 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
196- return new Response(serialized.value, {
197- status: ctx.set.status,
198- headers: ctx.set.headers,
199- })
210+ return (
211+ ctx.response = new Response(serialized.value, {
212+ status: ctx.set.status,
213+ headers: ctx.set.headers,
214+ })
215+ )
200216 }"
201217 ` ) ;
202218 } ) ;
@@ -230,18 +246,22 @@ describe("compileRouteHandler", () => {
230246 return onAfterHandleRes0;
231247
232248 if (ctx.response == null) {
233- return new Response(undefined, {
234- status: ctx.set.status,
235- headers: ctx.set.headers,
236- })
249+ return (
250+ ctx.response = new Response(undefined, {
251+ status: ctx.set.status,
252+ headers: ctx.set.headers,
253+ })
254+ )
237255 }
238256
239257 const serialized = utils.smartSerialize(ctx.response);
240258 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
241- return new Response(serialized.value, {
242- status: ctx.set.status,
243- headers: ctx.set.headers,
244- })
259+ return (
260+ ctx.response = new Response(serialized.value, {
261+ status: ctx.set.status,
262+ headers: ctx.set.headers,
263+ })
264+ )
245265 }"
246266 ` ) ;
247267 } ) ;
@@ -275,18 +295,22 @@ describe("compileRouteHandler", () => {
275295 return onMapResponseRes0;
276296
277297 if (ctx.response == null) {
278- return new Response(undefined, {
279- status: ctx.set.status,
280- headers: ctx.set.headers,
281- })
298+ return (
299+ ctx.response = new Response(undefined, {
300+ status: ctx.set.status,
301+ headers: ctx.set.headers,
302+ })
303+ )
282304 }
283305
284306 const serialized = utils.smartSerialize(ctx.response);
285307 if (!ctx.set.headers["Content-Type"]) ctx.set.headers["Content-Type"] = serialized.contentType
286- return new Response(serialized.value, {
287- status: ctx.set.status,
288- headers: ctx.set.headers,
289- })
308+ return (
309+ ctx.response = new Response(serialized.value, {
310+ status: ctx.set.status,
311+ headers: ctx.set.headers,
312+ })
313+ )
290314 }"
291315 ` ) ;
292316 } ) ;
0 commit comments