{"action":"created","comment":{"url":"https://api.github.com/repos/restify/node-restify/pulls/comments/32901986","id":32901986,"diff_hunk":"@@ -628,6 +629,15 @@ HttpClient.prototype._options = function (method, options) {\n         opts.socketPath = this.socketPath;\n     }\n \n+    // Add the request path to the base path of the client\n+    // Don't combine the request url and client path if they both\n+    // have a slash\n+    if (opts.path && this.url.path &&\n+        opts.path !== '/' && this.url.path !== '/') {\n+        // clean up the url path, stripping the last /\n+        opts.path = utils.sanitizePath([this.url.path, opts.path].join('/'));","path":"lib/clients/http_client.js","position":18,"original_position":18,"commit_id":"6ae476de1c9b60711c9e140476b809c449a62169","original_commit_id":"6ae476de1c9b60711c9e140476b809c449a62169","user":{"login":"DonutEspresso","id":2381315,"avatar_url":"https://avatars.githubusercontent.com/u/2381315?v=3","gravatar_id":"","url":"https://api.github.com/users/DonutEspresso","html_url":"https://github.com/DonutEspresso","followers_url":"https://api.github.com/users/DonutEspresso/followers","following_url":"https://api.github.com/users/DonutEspresso/following{/other_user}","gists_url":"https://api.github.com/users/DonutEspresso/gists{/gist_id}","starred_url":"https://api.github.com/users/DonutEspresso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonutEspresso/subscriptions","organizations_url":"https://api.github.com/users/DonutEspresso/orgs","repos_url":"https://api.github.com/users/DonutEspresso/repos","events_url":"https://api.github.com/users/DonutEspresso/events{/privacy}","received_events_url":"https://api.github.com/users/DonutEspresso/received_events","type":"User","site_admin":false},"body":"Based on #692, I think it's safe to say that we probably don't want to strip trailing slashes. Make the users be explicit?","created_at":"2015-06-22T02:21:44Z","updated_at":"2015-06-22T02:21:44Z","html_url":"https://github.com/restify/node-restify/pull/843#discussion_r32901986","pull_request_url":"https://api.github.com/repos/restify/node-restify/pulls/843","_links":{"self":{"href":"https://api.github.com/repos/restify/node-restify/pulls/comments/32901986"},"html":{"href":"https://github.com/restify/node-restify/pull/843#discussion_r32901986"},"pull_request":{"href":"https://api.github.com/repos/restify/node-restify/pulls/843"}}},"pull_request":{"url":"https://api.github.com/repos/restify/node-restify/pulls/843","id":38174529,"html_url":"https://github.com/restify/node-restify/pull/843","diff_url":"https://github.com/restify/node-restify/pull/843.diff","patch_url":"https://github.com/restify/node-restify/pull/843.patch","issue_url":"https://api.github.com/repos/restify/node-restify/issues/843","number":843,"state":"open","locked":false,"title":"Support URLs that have a path component","user":{"login":"micahr","id":111574,"avatar_url":"https://avatars.githubusercontent.com/u/111574?v=3","gravatar_id":"","url":"https://api.github.com/users/micahr","html_url":"https://github.com/micahr","followers_url":"https://api.github.com/users/micahr/followers","following_url":"https://api.github.com/users/micahr/following{/other_user}","gists_url":"https://api.github.com/users/micahr/gists{/gist_id}","starred_url":"https://api.github.com/users/micahr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahr/subscriptions","organizations_url":"https://api.github.com/users/micahr/orgs","repos_url":"https://api.github.com/users/micahr/repos","events_url":"https://api.github.com/users/micahr/events{/privacy}","received_events_url":"https://api.github.com/users/micahr/received_events","type":"User","site_admin":false},"body":"Combine both PRs #633 and #628 \r\n\r\nPull the logic from #633 and clean it up a bit\r\nPull the tests from #628\r\n\r\nThanks to both @nakosung and @calebbrown for their contributions.\r\n\r\nThe goal of this PR is to use the path from both the Client options and the requested url.\r\n\r\nFor example, when a user creates a client for a non-root url, any subsequent requests should use that as part of the request path.\r\n\r\n```javascript\r\nvar client = restify.createClient({\r\n    url: 'http://127.0.0.1/str'\r\n});\r\n\r\nclient.get('/foo', function (err, req, res, data){});\r\n```\r\n\r\nThe resulting request should go to `http://127.0.0.1/str/foo`.\r\n","created_at":"2015-06-20T21:20:18Z","updated_at":"2015-06-22T02:21:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45db98343707b16a4313e174e897025b4cc31bab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/restify/node-restify/pulls/843/commits","review_comments_url":"https://api.github.com/repos/restify/node-restify/pulls/843/comments","review_comment_url":"https://api.github.com/repos/restify/node-restify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/restify/node-restify/issues/843/comments","statuses_url":"https://api.github.com/repos/restify/node-restify/statuses/6ae476de1c9b60711c9e140476b809c449a62169","head":{"label":"restify:nakosung-patch","ref":"nakosung-patch","sha":"6ae476de1c9b60711c9e140476b809c449a62169","user":{"login":"restify","id":6948699,"avatar_url":"https://avatars.githubusercontent.com/u/6948699?v=3","gravatar_id":"","url":"https://api.github.com/users/restify","html_url":"https://github.com/restify","followers_url":"https://api.github.com/users/restify/followers","following_url":"https://api.github.com/users/restify/following{/other_user}","gists_url":"https://api.github.com/users/restify/gists{/gist_id}","starred_url":"https://api.github.com/users/restify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/restify/subscriptions","organizations_url":"https://api.github.com/users/restify/orgs","repos_url":"https://api.github.com/users/restify/repos","events_url":"https://api.github.com/users/restify/events{/privacy}","received_events_url":"https://api.github.com/users/restify/received_events","type":"Organization","site_admin":false},"repo":{"id":1661758,"name":"node-restify","full_name":"restify/node-restify","owner":{"login":"restify","id":6948699,"avatar_url":"https://avatars.githubusercontent.com/u/6948699?v=3","gravatar_id":"","url":"https://api.github.com/users/restify","html_url":"https://github.com/restify","followers_url":"https://api.github.com/users/restify/followers","following_url":"https://api.github.com/users/restify/following{/other_user}","gists_url":"https://api.github.com/users/restify/gists{/gist_id}","starred_url":"https://api.github.com/users/restify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/restify/subscriptions","organizations_url":"https://api.github.com/users/restify/orgs","repos_url":"https://api.github.com/users/restify/repos","events_url":"https://api.github.com/users/restify/events{/privacy}","received_events_url":"https://api.github.com/users/restify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/restify/node-restify","description":"node.js REST framework specifically meant for web service APIs","fork":false,"url":"https://api.github.com/repos/restify/node-restify","forks_url":"https://api.github.com/repos/restify/node-restify/forks","keys_url":"https://api.github.com/repos/restify/node-restify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/restify/node-restify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/restify/node-restify/teams","hooks_url":"https://api.github.com/repos/restify/node-restify/hooks","issue_events_url":"https://api.github.com/repos/restify/node-restify/issues/events{/number}","events_url":"https://api.github.com/repos/restify/node-restify/events","assignees_url":"https://api.github.com/repos/restify/node-restify/assignees{/user}","branches_url":"https://api.github.com/repos/restify/node-restify/branches{/branch}","tags_url":"https://api.github.com/repos/restify/node-restify/tags","blobs_url":"https://api.github.com/repos/restify/node-restify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/restify/node-restify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/restify/node-restify/git/refs{/sha}","trees_url":"https://api.github.com/repos/restify/node-restify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/restify/node-restify/statuses/{sha}","languages_url":"https://api.github.com/repos/restify/node-restify/languages","stargazers_url":"https://api.github.com/repos/restify/node-restify/stargazers","contributors_url":"https://api.github.com/repos/restify/node-restify/contributors","subscribers_url":"https://api.github.com/repos/restify/node-restify/subscribers","subscription_url":"https://api.github.com/repos/restify/node-restify/subscription","commits_url":"https://api.github.com/repos/restify/node-restify/commits{/sha}","git_commits_url":"https://api.github.com/repos/restify/node-restify/git/commits{/sha}","comments_url":"https://api.github.com/repos/restify/node-restify/comments{/number}","issue_comment_url":"https://api.github.com/repos/restify/node-restify/issues/comments{/number}","contents_url":"https://api.github.com/repos/restify/node-restify/contents/{+path}","compare_url":"https://api.github.com/repos/restify/node-restify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/restify/node-restify/merges","archive_url":"https://api.github.com/repos/restify/node-restify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/restify/node-restify/downloads","issues_url":"https://api.github.com/repos/restify/node-restify/issues{/number}","pulls_url":"https://api.github.com/repos/restify/node-restify/pulls{/number}","milestones_url":"https://api.github.com/repos/restify/node-restify/milestones{/number}","notifications_url":"https://api.github.com/repos/restify/node-restify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/restify/node-restify/labels{/name}","releases_url":"https://api.github.com/repos/restify/node-restify/releases{/id}","created_at":"2011-04-25T21:19:26Z","updated_at":"2015-06-21T03:42:21Z","pushed_at":"2015-06-22T02:00:42Z","git_url":"git://github.com/restify/node-restify.git","ssh_url":"git@github.com:restify/node-restify.git","clone_url":"https://github.com/restify/node-restify.git","svn_url":"https://github.com/restify/node-restify","homepage":"http://restifyjs.com","size":8836,"stargazers_count":3487,"watchers_count":3487,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":435,"mirror_url":null,"open_issues_count":91,"forks":435,"open_issues":91,"watchers":3487,"default_branch":"master"}},"base":{"label":"restify:master","ref":"master","sha":"8d716a3409eef7ec9dfa7d76f6d78f369530ca7e","user":{"login":"restify","id":6948699,"avatar_url":"https://avatars.githubusercontent.com/u/6948699?v=3","gravatar_id":"","url":"https://api.github.com/users/restify","html_url":"https://github.com/restify","followers_url":"https://api.github.com/users/restify/followers","following_url":"https://api.github.com/users/restify/following{/other_user}","gists_url":"https://api.github.com/users/restify/gists{/gist_id}","starred_url":"https://api.github.com/users/restify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/restify/subscriptions","organizations_url":"https://api.github.com/users/restify/orgs","repos_url":"https://api.github.com/users/restify/repos","events_url":"https://api.github.com/users/restify/events{/privacy}","received_events_url":"https://api.github.com/users/restify/received_events","type":"Organization","site_admin":false},"repo":{"id":1661758,"name":"node-restify","full_name":"restify/node-restify","owner":{"login":"restify","id":6948699,"avatar_url":"https://avatars.githubusercontent.com/u/6948699?v=3","gravatar_id":"","url":"https://api.github.com/users/restify","html_url":"https://github.com/restify","followers_url":"https://api.github.com/users/restify/followers","following_url":"https://api.github.com/users/restify/following{/other_user}","gists_url":"https://api.github.com/users/restify/gists{/gist_id}","starred_url":"https://api.github.com/users/restify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/restify/subscriptions","organizations_url":"https://api.github.com/users/restify/orgs","repos_url":"https://api.github.com/users/restify/repos","events_url":"https://api.github.com/users/restify/events{/privacy}","received_events_url":"https://api.github.com/users/restify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/restify/node-restify","description":"node.js REST framework specifically meant for web service APIs","fork":false,"url":"https://api.github.com/repos/restify/node-restify","forks_url":"https://api.github.com/repos/restify/node-restify/forks","keys_url":"https://api.github.com/repos/restify/node-restify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/restify/node-restify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/restify/node-restify/teams","hooks_url":"https://api.github.com/repos/restify/node-restify/hooks","issue_events_url":"https://api.github.com/repos/restify/node-restify/issues/events{/number}","events_url":"https://api.github.com/repos/restify/node-restify/events","assignees_url":"https://api.github.com/repos/restify/node-restify/assignees{/user}","branches_url":"https://api.github.com/repos/restify/node-restify/branches{/branch}","tags_url":"https://api.github.com/repos/restify/node-restify/tags","blobs_url":"https://api.github.com/repos/restify/node-restify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/restify/node-restify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/restify/node-restify/git/refs{/sha}","trees_url":"https://api.github.com/repos/restify/node-restify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/restify/node-restify/statuses/{sha}","languages_url":"https://api.github.com/repos/restify/node-restify/languages","stargazers_url":"https://api.github.com/repos/restify/node-restify/stargazers","contributors_url":"https://api.github.com/repos/restify/node-restify/contributors","subscribers_url":"https://api.github.com/repos/restify/node-restify/subscribers","subscription_url":"https://api.github.com/repos/restify/node-restify/subscription","commits_url":"https://api.github.com/repos/restify/node-restify/commits{/sha}","git_commits_url":"https://api.github.com/repos/restify/node-restify/git/commits{/sha}","comments_url":"https://api.github.com/repos/restify/node-restify/comments{/number}","issue_comment_url":"https://api.github.com/repos/restify/node-restify/issues/comments{/number}","contents_url":"https://api.github.com/repos/restify/node-restify/contents/{+path}","compare_url":"https://api.github.com/repos/restify/node-restify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/restify/node-restify/merges","archive_url":"https://api.github.com/repos/restify/node-restify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/restify/node-restify/downloads","issues_url":"https://api.github.com/repos/restify/node-restify/issues{/number}","pulls_url":"https://api.github.com/repos/restify/node-restify/pulls{/number}","milestones_url":"https://api.github.com/repos/restify/node-restify/milestones{/number}","notifications_url":"https://api.github.com/repos/restify/node-restify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/restify/node-restify/labels{/name}","releases_url":"https://api.github.com/repos/restify/node-restify/releases{/id}","created_at":"2011-04-25T21:19:26Z","updated_at":"2015-06-21T03:42:21Z","pushed_at":"2015-06-22T02:00:42Z","git_url":"git://github.com/restify/node-restify.git","ssh_url":"git@github.com:restify/node-restify.git","clone_url":"https://github.com/restify/node-restify.git","svn_url":"https://github.com/restify/node-restify","homepage":"http://restifyjs.com","size":8836,"stargazers_count":3487,"watchers_count":3487,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":435,"mirror_url":null,"open_issues_count":91,"forks":435,"open_issues":91,"watchers":3487,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/restify/node-restify/pulls/843"},"html":{"href":"https://github.com/restify/node-restify/pull/843"},"issue":{"href":"https://api.github.com/repos/restify/node-restify/issues/843"},"comments":{"href":"https://api.github.com/repos/restify/node-restify/issues/843/comments"},"review_comments":{"href":"https://api.github.com/repos/restify/node-restify/pulls/843/comments"},"review_comment":{"href":"https://api.github.com/repos/restify/node-restify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/restify/node-restify/pulls/843/commits"},"statuses":{"href":"https://api.github.com/repos/restify/node-restify/statuses/6ae476de1c9b60711c9e140476b809c449a62169"}}}}