Skip to content

Use http types from http crate #2389

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

Merged
merged 6 commits into from
Apr 12, 2020

Conversation

jtgeibel
Copy link
Member

@jtgeibel jtgeibel commented Apr 5, 2020

In the upstream conduit crates, I've dropped the custom HTTP related types in favor of types from the http crate. This reduces the amount of code to maintain upstream and generally provides a cleaner API, such as named StatusCode::* constants instead of naked integers.

This should also make it easier and more efficient to support both civet and hyper as web servers, as they (and our middleware stack) now use the same types and avoid unnecessary conversions.

r? @JohnTitor

@jtgeibel
Copy link
Member Author

jtgeibel commented Apr 5, 2020

I'm also pushing this to staging for some testing there. The deploy should finish within the next 15 minutes. (The deployed SHA is available in the site metadata which can be used to confirm staging still points to the latest commit in this PR, currently 5d0906e.)

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Looks good! Feel free to r=me if it's ready.

req.header(
// Needed for the error message we generate
// FIXME: Simplify once we hit `conduit-test 0.9.0-alpha.2`
header::HeaderName::from_lowercase(b"x-request-id").unwrap(),
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice the http crate had that header..

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Awesome! Thanks for opening the upstream PR.

@jtgeibel
Copy link
Member Author

@bors r=JohnTitor

@bors
Copy link
Contributor

bors commented Apr 12, 2020

📌 Commit 6985639 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Apr 12, 2020

⌛ Testing commit 6985639 with merge 1fff9e9...

@bors
Copy link
Contributor

bors commented Apr 12, 2020

☀️ Test successful - checks-travis
Approved by: JohnTitor
Pushing 1fff9e9 to master...

@bors bors merged commit 1fff9e9 into rust-lang:master Apr 12, 2020
@jtgeibel jtgeibel deleted the update/conduit/http-types branch May 11, 2020 23:18
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.

4 participants