ws icon indicating copy to clipboard operation
ws copied to clipboard

MaxReaderSize for wsutil.ReadClientData

Open ilovesusu opened this issue 3 years ago • 3 comments

Should you add a max read limit to wsutil.ReadClientData, otherwise, it's hard to use it in production

ilovesusu avatar Mar 08 '22 12:03 ilovesusu

That would be useful indeed. It's mostly about leveraging Reader.MaxFrameSize

Deleplace avatar May 10 '22 11:05 Deleplace

Can it be solved with https://pkg.go.dev/io#LimitedReader ? as a param to wsutil.ReadClientData

cristaloleg avatar May 10 '22 12:05 cristaloleg

Yes actually MaxFrameSize is not what we want here.

LimitedReader is a better candidate.

Deleplace avatar May 10 '22 15:05 Deleplace

Looks like the issue is resolved, closing. Feel free to reopen, thanks.

cristaloleg avatar May 24 '23 14:05 cristaloleg