When a request comes in without a valid Authorization header, the
innerRunStream generator sends a 401 response directly and returns.
However, the outer runCreateResponseStream continues and yields
response.completed, causing postCreateResponse to call res.json()
a second time - crashing the server with ERR_HTTP_HEADERS_SENT.
When a request comes in without a valid Authorization header, the
innerRunStream generator sends a 401 response directly and returns.
However, the outer runCreateResponseStream continues and yields
response.completed, causing postCreateResponse to call res.json()
a second time - crashing the server with ERR_HTTP_HEADERS_SENT.