Closed radu-matei closed 7 years ago
The exception comes from calling next.Invoke()
after writing to the stream (check the documentation, pretty much RTFM)
Basically, even if WebSockets don't go through the pipeline as HTTP requests do, the initial handshake and upgrade mechanisms are HTTP, so I was writing to the response stream and also invoking the next
middleware.
When this is the last middleware in the pipeline, Kestrel throws an unhandled exception