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

feat(http2): set Content-Length on outgoing messages #1556

Merged
merged 1 commit into from
Jun 10, 2018

Conversation

lnicola
Copy link
Contributor

@lnicola lnicola commented Jun 8, 2018

Fixes #1547

@lnicola
Copy link
Contributor Author

lnicola commented Jun 8, 2018

The server tests are ignored because they depend on #1546. We can either leave this open or fix them later.

tests/server.rs Outdated
client
.get(uri)
.and_then(|res| {
assert_eq!(res.body().content_length(), Some(13));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least the header can be checked for, right? assert_eq!(res.headers()["content-length"], "13").

With that, these #[ignore]s could be removed, and just the checking of res.body().content_length() could be commented out with a TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@seanmonstar seanmonstar merged commit 386fc0d into hyperium:master Jun 10, 2018
@seanmonstar
Copy link
Member

Excellent!

seanmonstar pushed a commit that referenced this pull request Jun 18, 2018
- Add `Body::Kind::H2` to contain the content length of the body.
- Update `Body::content_length` to return the content length if `Body::Kind` is `H2`, instead of returning `None`.

Reference: #1556, #1557

Closes #1546
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