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

Improve event data handling #212

Merged
merged 1 commit into from
Mar 13, 2022
Merged

Conversation

flacjacket
Copy link
Collaborator

It looks like the first two characters after the ContentLength is
specified are a carriage return. This has thrown off the json string
parsing leading to hand rolling regex which fails in odd ways (see #204).
Now, pull out a couple extra characters to get past this leading
carriage return. If the leading characters are not there, we should have
a trailing \r\n\r\n which is safe to add, and will just be stripped out.
With this change in place, we are able to use json parsing on data, with
a fallback to sending the data string.

It looks like the first two characters after the ContentLength is
specified are a carriage return. This has thrown off the json string
parsing leading to hand rolling regex which fails in odd ways (see tchellomello#204).
Now, pull out a couple extra characters to get past this leading
carriage return. If the leading characters are not there, we should have
a trailing \r\n\r\n which is safe to add, and will just be stripped out.
With this change in place, we are able to use json parsing on data, with
a fallback to sending the data string.
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

Successfully merging this pull request may close these issues.

1 participant