{"action":"created","comment":{"url":"https://api.github.com/repos/kaazing/gateway/pulls/comments/50848727","id":50848727,"diff_hunk":"@@ -108,16 +108,41 @@ public void initializeSession(IoSession session, ConnectFuture future) {\n             HttpConnectSession connectSession = (HttpConnectSession) session;\n             connectSession.setVersion(acceptSession.getVersion());\n             connectSession.setMethod(acceptSession.getMethod());\n-            String acceptPathInfo = acceptSession.getPathInfo().toString();\n-            if (acceptPathInfo.startsWith(\"/\")) {\n-                acceptPathInfo = acceptPathInfo.substring(1);\n+            URI connectURI = computeConnectPath(connectSession.getRequestURI());\n+            connectSession.setRequestURI(connectURI);\n+            processRequestHeaders(acceptSession, connectSession);\n+        }\n+\n+        private URI computeConnectPath(URI connectURI) {\n+            URI acceptURI = acceptSession.getServicePath();\n+            URI requestURI = acceptSession.getRequestURI();\n+            URI relativeURI = acceptURI.relativize(requestURI);\n+\n+            boolean hasExtraPath = relativeURI.getPath().length() > 0;\n+            boolean requestEndsInSlash = requestURI.getPath().endsWith(\"/\");\n+            String connectPath = connectURI.getPath();\n+            if (hasExtraPath || requestEndsInSlash) {","path":"service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java","position":20,"original_position":20,"commit_id":"105138bbd021567e9c88284b5d26218e5a637111","original_commit_id":"105138bbd021567e9c88284b5d26218e5a637111","user":{"login":"msalavastru","id":14290463,"avatar_url":"https://avatars.githubusercontent.com/u/14290463?v=3","gravatar_id":"","url":"https://api.github.com/users/msalavastru","html_url":"https://github.com/msalavastru","followers_url":"https://api.github.com/users/msalavastru/followers","following_url":"https://api.github.com/users/msalavastru/following{/other_user}","gists_url":"https://api.github.com/users/msalavastru/gists{/gist_id}","starred_url":"https://api.github.com/users/msalavastru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msalavastru/subscriptions","organizations_url":"https://api.github.com/users/msalavastru/orgs","repos_url":"https://api.github.com/users/msalavastru/repos","events_url":"https://api.github.com/users/msalavastru/events{/privacy}","received_events_url":"https://api.github.com/users/msalavastru/received_events","type":"User","site_admin":false},"body":"- hasExtraPath - checks for path in request ( with or without query and/or fragments )\r\n- requestEndsInSlash - covers the scenario where the request has no path and no query.","created_at":"2016-01-26T15:26:10Z","updated_at":"2016-01-26T15:26:10Z","html_url":"https://github.com/kaazing/gateway/pull/405#discussion_r50848727","pull_request_url":"https://api.github.com/repos/kaazing/gateway/pulls/405","_links":{"self":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/comments/50848727"},"html":{"href":"https://github.com/kaazing/gateway/pull/405#discussion_r50848727"},"pull_request":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/405"}}},"pull_request":{"url":"https://api.github.com/repos/kaazing/gateway/pulls/405","id":56616483,"html_url":"https://github.com/kaazing/gateway/pull/405","diff_url":"https://github.com/kaazing/gateway/pull/405.diff","patch_url":"https://github.com/kaazing/gateway/pull/405.patch","issue_url":"https://api.github.com/repos/kaazing/gateway/issues/405","number":405,"state":"open","locked":false,"title":"A minor fix for issue 183","user":{"login":"msalavastru","id":14290463,"avatar_url":"https://avatars.githubusercontent.com/u/14290463?v=3","gravatar_id":"","url":"https://api.github.com/users/msalavastru","html_url":"https://github.com/msalavastru","followers_url":"https://api.github.com/users/msalavastru/followers","following_url":"https://api.github.com/users/msalavastru/following{/other_user}","gists_url":"https://api.github.com/users/msalavastru/gists{/gist_id}","starred_url":"https://api.github.com/users/msalavastru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msalavastru/subscriptions","organizations_url":"https://api.github.com/users/msalavastru/orgs","repos_url":"https://api.github.com/users/msalavastru/repos","events_url":"https://api.github.com/users/msalavastru/events{/privacy}","received_events_url":"https://api.github.com/users/msalavastru/received_events","type":"User","site_admin":false},"body":"Fixed the appending of the last \"/\" to the connect path when there is no accept request path.","created_at":"2016-01-20T14:45:21Z","updated_at":"2016-01-26T15:26:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5714913f1b43ec1efa3ce704cf9458b340ce7436","assignee":{"login":"jitsni","id":5131125,"avatar_url":"https://avatars.githubusercontent.com/u/5131125?v=3","gravatar_id":"","url":"https://api.github.com/users/jitsni","html_url":"https://github.com/jitsni","followers_url":"https://api.github.com/users/jitsni/followers","following_url":"https://api.github.com/users/jitsni/following{/other_user}","gists_url":"https://api.github.com/users/jitsni/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsni/subscriptions","organizations_url":"https://api.github.com/users/jitsni/orgs","repos_url":"https://api.github.com/users/jitsni/repos","events_url":"https://api.github.com/users/jitsni/events{/privacy}","received_events_url":"https://api.github.com/users/jitsni/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kaazing/gateway/pulls/405/commits","review_comments_url":"https://api.github.com/repos/kaazing/gateway/pulls/405/comments","review_comment_url":"https://api.github.com/repos/kaazing/gateway/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaazing/gateway/issues/405/comments","statuses_url":"https://api.github.com/repos/kaazing/gateway/statuses/105138bbd021567e9c88284b5d26218e5a637111","head":{"label":"msalavastru:issue.183.fix","ref":"issue.183.fix","sha":"105138bbd021567e9c88284b5d26218e5a637111","user":{"login":"msalavastru","id":14290463,"avatar_url":"https://avatars.githubusercontent.com/u/14290463?v=3","gravatar_id":"","url":"https://api.github.com/users/msalavastru","html_url":"https://github.com/msalavastru","followers_url":"https://api.github.com/users/msalavastru/followers","following_url":"https://api.github.com/users/msalavastru/following{/other_user}","gists_url":"https://api.github.com/users/msalavastru/gists{/gist_id}","starred_url":"https://api.github.com/users/msalavastru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msalavastru/subscriptions","organizations_url":"https://api.github.com/users/msalavastru/orgs","repos_url":"https://api.github.com/users/msalavastru/repos","events_url":"https://api.github.com/users/msalavastru/events{/privacy}","received_events_url":"https://api.github.com/users/msalavastru/received_events","type":"User","site_admin":false},"repo":{"id":43746236,"name":"gateway","full_name":"msalavastru/gateway","owner":{"login":"msalavastru","id":14290463,"avatar_url":"https://avatars.githubusercontent.com/u/14290463?v=3","gravatar_id":"","url":"https://api.github.com/users/msalavastru","html_url":"https://github.com/msalavastru","followers_url":"https://api.github.com/users/msalavastru/followers","following_url":"https://api.github.com/users/msalavastru/following{/other_user}","gists_url":"https://api.github.com/users/msalavastru/gists{/gist_id}","starred_url":"https://api.github.com/users/msalavastru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msalavastru/subscriptions","organizations_url":"https://api.github.com/users/msalavastru/orgs","repos_url":"https://api.github.com/users/msalavastru/repos","events_url":"https://api.github.com/users/msalavastru/events{/privacy}","received_events_url":"https://api.github.com/users/msalavastru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/msalavastru/gateway","description":"Kaazing Gateway","fork":true,"url":"https://api.github.com/repos/msalavastru/gateway","forks_url":"https://api.github.com/repos/msalavastru/gateway/forks","keys_url":"https://api.github.com/repos/msalavastru/gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msalavastru/gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msalavastru/gateway/teams","hooks_url":"https://api.github.com/repos/msalavastru/gateway/hooks","issue_events_url":"https://api.github.com/repos/msalavastru/gateway/issues/events{/number}","events_url":"https://api.github.com/repos/msalavastru/gateway/events","assignees_url":"https://api.github.com/repos/msalavastru/gateway/assignees{/user}","branches_url":"https://api.github.com/repos/msalavastru/gateway/branches{/branch}","tags_url":"https://api.github.com/repos/msalavastru/gateway/tags","blobs_url":"https://api.github.com/repos/msalavastru/gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msalavastru/gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msalavastru/gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/msalavastru/gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msalavastru/gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/msalavastru/gateway/languages","stargazers_url":"https://api.github.com/repos/msalavastru/gateway/stargazers","contributors_url":"https://api.github.com/repos/msalavastru/gateway/contributors","subscribers_url":"https://api.github.com/repos/msalavastru/gateway/subscribers","subscription_url":"https://api.github.com/repos/msalavastru/gateway/subscription","commits_url":"https://api.github.com/repos/msalavastru/gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/msalavastru/gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/msalavastru/gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/msalavastru/gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/msalavastru/gateway/contents/{+path}","compare_url":"https://api.github.com/repos/msalavastru/gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msalavastru/gateway/merges","archive_url":"https://api.github.com/repos/msalavastru/gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msalavastru/gateway/downloads","issues_url":"https://api.github.com/repos/msalavastru/gateway/issues{/number}","pulls_url":"https://api.github.com/repos/msalavastru/gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/msalavastru/gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/msalavastru/gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msalavastru/gateway/labels{/name}","releases_url":"https://api.github.com/repos/msalavastru/gateway/releases{/id}","deployments_url":"https://api.github.com/repos/msalavastru/gateway/deployments","created_at":"2015-10-06T11:24:09Z","updated_at":"2015-10-06T11:24:18Z","pushed_at":"2016-01-26T15:21:02Z","git_url":"git://github.com/msalavastru/gateway.git","ssh_url":"git@github.com:msalavastru/gateway.git","clone_url":"https://github.com/msalavastru/gateway.git","svn_url":"https://github.com/msalavastru/gateway","homepage":"","size":12605,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"kaazing:develop","ref":"develop","sha":"e26087d8c99a0962f571fcbd559a280f15667574","user":{"login":"kaazing","id":1056680,"avatar_url":"https://avatars.githubusercontent.com/u/1056680?v=3","gravatar_id":"","url":"https://api.github.com/users/kaazing","html_url":"https://github.com/kaazing","followers_url":"https://api.github.com/users/kaazing/followers","following_url":"https://api.github.com/users/kaazing/following{/other_user}","gists_url":"https://api.github.com/users/kaazing/gists{/gist_id}","starred_url":"https://api.github.com/users/kaazing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaazing/subscriptions","organizations_url":"https://api.github.com/users/kaazing/orgs","repos_url":"https://api.github.com/users/kaazing/repos","events_url":"https://api.github.com/users/kaazing/events{/privacy}","received_events_url":"https://api.github.com/users/kaazing/received_events","type":"Organization","site_admin":false},"repo":{"id":26745548,"name":"gateway","full_name":"kaazing/gateway","owner":{"login":"kaazing","id":1056680,"avatar_url":"https://avatars.githubusercontent.com/u/1056680?v=3","gravatar_id":"","url":"https://api.github.com/users/kaazing","html_url":"https://github.com/kaazing","followers_url":"https://api.github.com/users/kaazing/followers","following_url":"https://api.github.com/users/kaazing/following{/other_user}","gists_url":"https://api.github.com/users/kaazing/gists{/gist_id}","starred_url":"https://api.github.com/users/kaazing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaazing/subscriptions","organizations_url":"https://api.github.com/users/kaazing/orgs","repos_url":"https://api.github.com/users/kaazing/repos","events_url":"https://api.github.com/users/kaazing/events{/privacy}","received_events_url":"https://api.github.com/users/kaazing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaazing/gateway","description":"Kaazing Gateway","fork":false,"url":"https://api.github.com/repos/kaazing/gateway","forks_url":"https://api.github.com/repos/kaazing/gateway/forks","keys_url":"https://api.github.com/repos/kaazing/gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaazing/gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaazing/gateway/teams","hooks_url":"https://api.github.com/repos/kaazing/gateway/hooks","issue_events_url":"https://api.github.com/repos/kaazing/gateway/issues/events{/number}","events_url":"https://api.github.com/repos/kaazing/gateway/events","assignees_url":"https://api.github.com/repos/kaazing/gateway/assignees{/user}","branches_url":"https://api.github.com/repos/kaazing/gateway/branches{/branch}","tags_url":"https://api.github.com/repos/kaazing/gateway/tags","blobs_url":"https://api.github.com/repos/kaazing/gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaazing/gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaazing/gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaazing/gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaazing/gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/kaazing/gateway/languages","stargazers_url":"https://api.github.com/repos/kaazing/gateway/stargazers","contributors_url":"https://api.github.com/repos/kaazing/gateway/contributors","subscribers_url":"https://api.github.com/repos/kaazing/gateway/subscribers","subscription_url":"https://api.github.com/repos/kaazing/gateway/subscription","commits_url":"https://api.github.com/repos/kaazing/gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaazing/gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaazing/gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaazing/gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaazing/gateway/contents/{+path}","compare_url":"https://api.github.com/repos/kaazing/gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaazing/gateway/merges","archive_url":"https://api.github.com/repos/kaazing/gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaazing/gateway/downloads","issues_url":"https://api.github.com/repos/kaazing/gateway/issues{/number}","pulls_url":"https://api.github.com/repos/kaazing/gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/kaazing/gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/kaazing/gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaazing/gateway/labels{/name}","releases_url":"https://api.github.com/repos/kaazing/gateway/releases{/id}","deployments_url":"https://api.github.com/repos/kaazing/gateway/deployments","created_at":"2014-11-17T07:40:57Z","updated_at":"2016-01-18T18:32:32Z","pushed_at":"2016-01-26T15:21:03Z","git_url":"git://github.com/kaazing/gateway.git","ssh_url":"git@github.com:kaazing/gateway.git","clone_url":"https://github.com/kaazing/gateway.git","svn_url":"https://github.com/kaazing/gateway","homepage":"","size":13806,"stargazers_count":41,"watchers_count":41,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":83,"forks":38,"open_issues":83,"watchers":41,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/405"},"html":{"href":"https://github.com/kaazing/gateway/pull/405"},"issue":{"href":"https://api.github.com/repos/kaazing/gateway/issues/405"},"comments":{"href":"https://api.github.com/repos/kaazing/gateway/issues/405/comments"},"review_comments":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/405/comments"},"review_comment":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaazing/gateway/pulls/405/commits"},"statuses":{"href":"https://api.github.com/repos/kaazing/gateway/statuses/105138bbd021567e9c88284b5d26218e5a637111"}}}}