{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/198748817","pull_request_review_id":132733602,"id":198748817,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODc0ODgxNw==","diff_hunk":"@@ -796,12 +796,8 @@ static URI buildUri(String pathPrefix, String path, Map<String, String> params)\n         Objects.requireNonNull(path, \"path must not be null\");\n         try {\n             String fullPath;\n-            if (pathPrefix != null) {\n-                if (path.startsWith(\"/\")) {\n-                    fullPath = pathPrefix + path;\n-                } else {\n-                    fullPath = pathPrefix + \"/\" + path;\n-                }\n+            if (pathPrefix != null && !pathPrefix.isEmpty()) {\n+                fullPath = (pathPrefix + \"/\" + path).replaceAll(\"//+\", \"/\");","path":"client/rest/src/main/java/org/elasticsearch/client/RestClient.java","position":11,"original_position":11,"commit_id":"1e43c7a7e1d70a3918eb6d4b7d7c8e9c1f0cfe99","original_commit_id":"1e43c7a7e1d70a3918eb6d4b7d7c8e9c1f0cfe99","user":{"login":"beiske","id":98256,"node_id":"MDQ6VXNlcjk4MjU2","avatar_url":"https://avatars2.githubusercontent.com/u/98256?v=4","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"body":"A `pathPrefix` that is a single slash, would also be a `pathPrefix` that ends with a slash. So a naturalæ consequence of using the `pathPrefix` to ensure there always is a leading slash is allowing `pathPrefix` with a trailing slash. Of course one could make a special case for trailing slash when it is the entire prefix, but that seemed like very circumstantial logic to me.","created_at":"2018-06-28T08:23:20Z","updated_at":"2018-06-28T08:23:21Z","html_url":"https://github.com/elastic/elasticsearch/pull/30119#discussion_r198748817","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/198748817"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/30119#discussion_r198748817"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119"}},"in_reply_to_id":198641489},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119","id":183974300,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgzOTc0MzAw","html_url":"https://github.com/elastic/elasticsearch/pull/30119","diff_url":"https://github.com/elastic/elasticsearch/pull/30119.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/30119.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/30119","number":30119,"state":"open","locked":false,"title":"Enable setting client.path.prefix='/'","user":{"login":"beiske","id":98256,"node_id":"MDQ6VXNlcjk4MjU2","avatar_url":"https://avatars2.githubusercontent.com/u/98256?v=4","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"body":"These are changes for running the rest tests against a cluster on Cloud.\r\n\r\n* Ensure all paths have a leading `/` by setting path prefix\r\n* ~Allow adding additional blacklisted tests for `CoreWithSecurityClientYamlTestSuiteIT`~ (Merged in #31074)\r\n* ~Allow specifying custom cluster credentials for `CoreWithSecurityClientYamlTestSuiteIT`~ (Merged in #31235)","created_at":"2018-04-25T09:28:41Z","updated_at":"2018-06-28T08:23:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"107d9f60f4f924212763c4cb6b9687fa97e89c03","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":106454670,"node_id":"MDU6TGFiZWwxMDY0NTQ2NzA=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Core/Build","name":":Core/Build","color":"0e8a16","default":false},{"id":60445228,"node_id":"MDU6TGFiZWw2MDQ0NTIyOA==","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Etest","name":">test","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/30119/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/1e43c7a7e1d70a3918eb6d4b7d7c8e9c1f0cfe99","head":{"label":"beiske:rest-tests-against-cloud","ref":"rest-tests-against-cloud","sha":"1e43c7a7e1d70a3918eb6d4b7d7c8e9c1f0cfe99","user":{"login":"beiske","id":98256,"node_id":"MDQ6VXNlcjk4MjU2","avatar_url":"https://avatars2.githubusercontent.com/u/98256?v=4","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"repo":{"id":41142990,"node_id":"MDEwOlJlcG9zaXRvcnk0MTE0Mjk5MA==","name":"elasticsearch","full_name":"beiske/elasticsearch","owner":{"login":"beiske","id":98256,"node_id":"MDQ6VXNlcjk4MjU2","avatar_url":"https://avatars2.githubusercontent.com/u/98256?v=4","gravatar_id":"","url":"https://api.github.com/users/beiske","html_url":"https://github.com/beiske","followers_url":"https://api.github.com/users/beiske/followers","following_url":"https://api.github.com/users/beiske/following{/other_user}","gists_url":"https://api.github.com/users/beiske/gists{/gist_id}","starred_url":"https://api.github.com/users/beiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beiske/subscriptions","organizations_url":"https://api.github.com/users/beiske/orgs","repos_url":"https://api.github.com/users/beiske/repos","events_url":"https://api.github.com/users/beiske/events{/privacy}","received_events_url":"https://api.github.com/users/beiske/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beiske/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/beiske/elasticsearch","forks_url":"https://api.github.com/repos/beiske/elasticsearch/forks","keys_url":"https://api.github.com/repos/beiske/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beiske/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beiske/elasticsearch/teams","hooks_url":"https://api.github.com/repos/beiske/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/beiske/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/beiske/elasticsearch/events","assignees_url":"https://api.github.com/repos/beiske/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/beiske/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/beiske/elasticsearch/tags","blobs_url":"https://api.github.com/repos/beiske/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beiske/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beiske/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/beiske/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beiske/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/beiske/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/beiske/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/beiske/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/beiske/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/beiske/elasticsearch/subscription","commits_url":"https://api.github.com/repos/beiske/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/beiske/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/beiske/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/beiske/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/beiske/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/beiske/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beiske/elasticsearch/merges","archive_url":"https://api.github.com/repos/beiske/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beiske/elasticsearch/downloads","issues_url":"https://api.github.com/repos/beiske/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/beiske/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/beiske/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/beiske/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beiske/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/beiske/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/beiske/elasticsearch/deployments","created_at":"2015-08-21T07:49:03Z","updated_at":"2015-08-21T07:49:24Z","pushed_at":"2018-06-27T09:26:19Z","git_url":"git://github.com/beiske/elasticsearch.git","ssh_url":"git@github.com:beiske/elasticsearch.git","clone_url":"https://github.com/beiske/elasticsearch.git","svn_url":"https://github.com/beiske/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":368532,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"b7246199db2c788250e03b804493b3548df8b288","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2018-06-28T07:38:10Z","pushed_at":"2018-06-28T08:08:01Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":493946,"stargazers_count":32052,"watchers_count":32052,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11011,"mirror_url":null,"archived":false,"open_issues_count":1474,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11011,"open_issues":1474,"watchers":32052,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/30119"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/30119"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/30119/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30119/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/1e43c7a7e1d70a3918eb6d4b7d7c8e9c1f0cfe99"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"beiske"}}