{"action":"created","issue":{"url":"https://api.github.com/repos/runconduit/conduit/issues/492","repository_url":"https://api.github.com/repos/runconduit/conduit","labels_url":"https://api.github.com/repos/runconduit/conduit/issues/492/labels{/name}","comments_url":"https://api.github.com/repos/runconduit/conduit/issues/492/comments","events_url":"https://api.github.com/repos/runconduit/conduit/issues/492/events","html_url":"https://github.com/runconduit/conduit/pull/492","id":301599354,"number":492,"title":"Enforce that requests are mapped to connections for each Host: header values","user":{"login":"hawkw","id":2796466,"avatar_url":"https://avatars1.githubusercontent.com/u/2796466?v=4","gravatar_id":"","url":"https://api.github.com/users/hawkw","html_url":"https://github.com/hawkw","followers_url":"https://api.github.com/users/hawkw/followers","following_url":"https://api.github.com/users/hawkw/following{/other_user}","gists_url":"https://api.github.com/users/hawkw/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkw/subscriptions","organizations_url":"https://api.github.com/users/hawkw/orgs","repos_url":"https://api.github.com/users/hawkw/repos","events_url":"https://api.github.com/users/hawkw/events{/privacy}","received_events_url":"https://api.github.com/users/hawkw/received_events","type":"User","site_admin":false},"labels":[{"id":773709989,"url":"https://api.github.com/repos/runconduit/conduit/labels/proxy","name":"proxy","color":"dea584","default":false},{"id":795382493,"url":"https://api.github.com/repos/runconduit/conduit/labels/review","name":"review","color":"ededed","default":false},{"id":842180053,"url":"https://api.github.com/repos/runconduit/conduit/labels/security","name":"security","color":"f99fe7","default":false}],"state":"open","locked":false,"assignee":{"login":"hawkw","id":2796466,"avatar_url":"https://avatars1.githubusercontent.com/u/2796466?v=4","gravatar_id":"","url":"https://api.github.com/users/hawkw","html_url":"https://github.com/hawkw","followers_url":"https://api.github.com/users/hawkw/followers","following_url":"https://api.github.com/users/hawkw/following{/other_user}","gists_url":"https://api.github.com/users/hawkw/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkw/subscriptions","organizations_url":"https://api.github.com/users/hawkw/orgs","repos_url":"https://api.github.com/users/hawkw/repos","events_url":"https://api.github.com/users/hawkw/events{/privacy}","received_events_url":"https://api.github.com/users/hawkw/received_events","type":"User","site_admin":false},"assignees":[{"login":"hawkw","id":2796466,"avatar_url":"https://avatars1.githubusercontent.com/u/2796466?v=4","gravatar_id":"","url":"https://api.github.com/users/hawkw","html_url":"https://github.com/hawkw","followers_url":"https://api.github.com/users/hawkw/followers","following_url":"https://api.github.com/users/hawkw/following{/other_user}","gists_url":"https://api.github.com/users/hawkw/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkw/subscriptions","organizations_url":"https://api.github.com/users/hawkw/orgs","repos_url":"https://api.github.com/users/hawkw/repos","events_url":"https://api.github.com/users/hawkw/events{/privacy}","received_events_url":"https://api.github.com/users/hawkw/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/runconduit/conduit/milestones/9","html_url":"https://github.com/runconduit/conduit/milestone/9","labels_url":"https://api.github.com/repos/runconduit/conduit/milestones/9/labels","id":3134671,"number":9,"title":"0.3.1","description":"Transparency & Discovery stability","creator":{"login":"olix0r","id":240738,"avatar_url":"https://avatars3.githubusercontent.com/u/240738?v=4","gravatar_id":"","url":"https://api.github.com/users/olix0r","html_url":"https://github.com/olix0r","followers_url":"https://api.github.com/users/olix0r/followers","following_url":"https://api.github.com/users/olix0r/following{/other_user}","gists_url":"https://api.github.com/users/olix0r/gists{/gist_id}","starred_url":"https://api.github.com/users/olix0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olix0r/subscriptions","organizations_url":"https://api.github.com/users/olix0r/orgs","repos_url":"https://api.github.com/users/olix0r/repos","events_url":"https://api.github.com/users/olix0r/events{/privacy}","received_events_url":"https://api.github.com/users/olix0r/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":30,"state":"open","created_at":"2018-02-21T21:44:40Z","updated_at":"2018-03-06T18:01:46Z","due_on":"2018-03-07T08:00:00Z","closed_at":null},"comments":10,"created_at":"2018-03-01T23:30:49Z","updated_at":"2018-03-06T21:16:24Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/runconduit/conduit/pulls/492","html_url":"https://github.com/runconduit/conduit/pull/492","diff_url":"https://github.com/runconduit/conduit/pull/492.diff","patch_url":"https://github.com/runconduit/conduit/pull/492.patch"},"body":"This ended up being a much bigger branch than anticipated --- sorry for so much code to review!\r\n\r\nThis PR ensures that the mapping of requests to outbound connections is segregated by `Host:` header values. In most cases, the desired behavior is provided by Hyper's connection pooling. However, Hyper does not handle the case where a request had no `Host:` header and the request URI had no authority part, and the request was routed based on the SO_ORIGINAL_DST in the desired manner. We would like these requests to each have their own outbound connection, but Hyper will reuse the same connection for such requests. \r\n\r\nTherefore, I have modified `conduit_proxy_router::Recognize` to allow implementations of `Recognize` to indicate whether the service for a given key can be cached, and to only cache the service when it is marked as cachable. I've also changed the `reconstruct_uri` function, which rewrites HTTP/1 requests, to mark when a request had no authority and no `Host:` header, and the authority was rewritten to be the request's ORIGINAL_DST. When this is the case, the `Recognize` implementations for `Inbound` and `Outbound` will mark these requests as non-cachable.\r\n\r\nI've also added unit tests ensuring that A, connections are created per `Host:` header, and B, that requests with no `Host:` header each create a new connection. The first test passes without any additional changes, but the second only passes on this branch. The tests were added in PR #489, but this branch supersedes that branch.\r\n\r\nThis branch @seanmonstar's  `proxy-te` branch, so we should merge this branch after we merge his PR #457.\r\n\r\nFixes #415. Closes #489."},"comment":{"url":"https://api.github.com/repos/runconduit/conduit/issues/comments/370931103","html_url":"https://github.com/runconduit/conduit/pull/492#issuecomment-370931103","issue_url":"https://api.github.com/repos/runconduit/conduit/issues/492","id":370931103,"user":{"login":"hawkw","id":2796466,"avatar_url":"https://avatars1.githubusercontent.com/u/2796466?v=4","gravatar_id":"","url":"https://api.github.com/users/hawkw","html_url":"https://github.com/hawkw","followers_url":"https://api.github.com/users/hawkw/followers","following_url":"https://api.github.com/users/hawkw/following{/other_user}","gists_url":"https://api.github.com/users/hawkw/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkw/subscriptions","organizations_url":"https://api.github.com/users/hawkw/orgs","repos_url":"https://api.github.com/users/hawkw/repos","events_url":"https://api.github.com/users/hawkw/events{/privacy}","received_events_url":"https://api.github.com/users/hawkw/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T21:16:24Z","updated_at":"2018-03-06T21:16:24Z","author_association":"MEMBER","body":"@briansmith \r\n> Right. What I'm asking is if it makes sense to remove the extension, considering the issues in #518. Won't we need the extension to fix #518? I guess if we do, we can always undo #514.\r\n\r\nIt's possible that I'm wrong, but I don't think we will need the extension to fix #518 ---  based on my understanding of the issue, I think we can just make changes to the behaviour of `reconstruct_uri`?. Regardless, though, I think having a service that is added after `Bind` is the correct factoring for this behaviour, even if we do eventually end up adding an extension as well.\r\n\r\n> We can do the tests as part of #518.\r\nOkay, thanks for clearing that up!"}}
{"actor":{"display_login":"hawkw"}}