-
Notifications
You must be signed in to change notification settings - Fork 270
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
Use the connection's HTTP version in transport header #1533
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,15 +163,15 @@ impl<C, T> HyperConnect<C, T> { | |
pub(super) fn new(connect: C, target: T, absolute_form: bool) -> Self { | ||
HyperConnect { | ||
connect, | ||
absolute_form, | ||
target, | ||
absolute_form, | ||
} | ||
} | ||
} | ||
|
||
impl<C, T> Service<hyper::Uri> for HyperConnect<C, T> | ||
where | ||
C: MakeConnection<T> + Clone + Send + Sync, | ||
C: MakeConnection<(crate::Version, T)> + Clone + Send + Sync, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this kind of makes me wonder if the impl<T, P> Param<P> for Connect<T> where T: Param<P> { ... } without conflicting with the existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, agreed that it would be a lot nicer with blanket impls. in general, though, I prefer to keep the target types in the modules from which they are emitted. |
||
C::Connection: Unpin + Send, | ||
C::Future: Unpin + Send + 'static, | ||
T: Clone + Send + Sync, | ||
|
@@ -186,7 +186,9 @@ where | |
|
||
fn call(&mut self, _dst: hyper::Uri) -> Self::Future { | ||
HyperConnectFuture { | ||
inner: self.connect.connect(self.target.clone()), | ||
inner: self | ||
.connect | ||
.connect((crate::Version::Http1, self.target.clone())), | ||
absolute_form: self.absolute_form, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the PR makes sense to me but I'm struggling a bit to understand what we are doing here. My guess is that we do not care about the version here because these clients are going to be used with the main application container? I suppose we don't actually want to check the
connection
header for anUpgrade
value and just forward everything as is?Similarly, in
control.rs
, I suppose we'd never need to consider the connection header was set by the client app and we can safely upgrade to H2 which is why we don't care about the version and just use the target?Would this reasoning be close to what's going on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only in the outbound case can the protocol be upgraded from HTTP/1 to HTTP/2; so in both of these cases: