Conversation
|
Can one of the admins verify this patch? |
5 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
dnadoba
left a comment
There was a problem hiding this comment.
Thanks! This is almost good to go.
| uri: "\(self.targetHost):\(self.targetPort)" | ||
| ) | ||
| head.headers.replaceOrAdd(name: "host", value: "\(self.targetHost)") | ||
| if !head.headers.contains(name: "host") { |
There was a problem hiding this comment.
The HTTPRequestHead is created in the lines above and we can therefore say for sure we will never have a host set. This makes sense because we don't need to look into the headers we have created here but from the original HTTP request from the user. This will require plumping the HTTPHeaders from the original request through the stack.
FYI: @rnro is currently working on moving HTTP1ProxyConnectHandler to swift-nio-extras in this PR. In this new version the HTTPHeaders are passed into the HTTP1ProxyConnectHandler.init which makes this a bit easier. We still need to get the original request headers to where we create the HTTP1ProxyConnectHandler in AHC.
Added check to add host only if needed, and also building host the right way.