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

Make HttpObjectDecoder more RFC7230 compatible and other improvements #1227

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

idelpivnitskiy
Copy link
Member

@idelpivnitskiy idelpivnitskiy commented Nov 20, 2020

Motivation:

RFC7230 defines obs-text as %x80-FF (any negative byte value), and
reason-phrase as *( HTAB / SP / VCHAR / obs-text ).

Modifications:

  • Adjust isObsText and reason-phrase validation according to RFC7230;
  • Verify that the passed closeHandler is non-null;

Result:

HttpObjectDecoder is more robust and RFC7230 compatible.

Motivation:

RFC7230 defines `obs-text` as `%x80-FF` (any negative byte value), and
reason-phrase as `*( HTAB / SP / VCHAR / obs-text )`.

Modifications:

- Adjust `isObsText` and reason-phrase validation according to RFC7230;
- Verify that the passed `closeHandler` is non-null;
- Return fast if the buffer is not readable after skipping control chars;

Result:

`HttpObjectDecoder` is more robust and RFC7230 compatible.
@idelpivnitskiy idelpivnitskiy merged commit 7eb37c3 into apple:main Nov 20, 2020
@idelpivnitskiy idelpivnitskiy deleted the http-decoder-fix branch November 20, 2020 23:51
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.

2 participants