Replace wlock.TryLock() with a proper Lock() + closed flag to prevent writing to a response writer that has been cleaned up after the handler returns. The previous TryLock approach could not guarantee the response writer was still valid when a concurrent Publish goroutine called Flush.
85 KiB
85 KiB