Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t parse incoming msg #63

Open
ser-evegenii opened this issue Sep 15, 2021 · 0 comments
Open

Can`t parse incoming msg #63

ser-evegenii opened this issue Sep 15, 2021 · 0 comments

Comments

@ser-evegenii
Copy link

ser-evegenii commented Sep 15, 2021

Hello
Cant parse incoming msg with response body.
The problem is, that in go1.16 json stream library by default add '\n',
/src/encoding/json/stream.go
// Terminate each value with a newline.
// This makes the output look a little nicer
// when debugging, and some kind of space
// is required if the encoded value was a number,
// so that the reader knows there aren't more
// digits coming.
e.WriteByte('\n')

but in one of incoming parser in golang-socketio that situation does not handle.
I talk about golang-socketio/protocol/socketio.go 141 line

func getMethod(text string) (method, restText string, err error) {
var start, end, rest, countQuote int
for i, c := range text {

and a good way is add treaming '\n' symbol

func getMethod(text string) (method, restText string, err error) {
var start, end, rest, countQuote int
text = strings.Trim(text, "\n")
for i, c := range text {

i tried to make a pull request but it seems, that i dont have rights for create branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant