#how to end response without using "nativeEvent"?

2 messages · Page 1 of 1 (latest)

maiden leaf
#

what would be a better way of writing the following inside of middleware?

 event.nativeEvent.res.writeHead(403).end();
 return;

Returning a new Response() gives a type error (but works as expected) and just setting the event.response.status and returning doesn't end the response

wicked python
#

What's the type error? As returning early is the way to end early