websocket icon indicating copy to clipboard operation
websocket copied to clipboard

[BUG] Potential Handle Leak?

Open stasos24 opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

https://github.com/gorilla/websocket/blob/6f5d2139f4b96d5edfe6c1aac4fe87fed8d7f9fd/proxy.go#L70 According to https://pkg.go.dev/net/http#ReadResponse Clients must call resp.Body.Close when finished reading resp.Body

Expected Behavior

defer resp.Body.Close() at 77?

Steps To Reproduce

No response

Anything else?

No response

stasos24 avatar Nov 28 '23 07:11 stasos24

The handle conn is returned to the caller a few lines after the code linked from the issue.

ghost avatar Dec 11 '23 20:12 ghost