{"action":"created","issue":{"url":"https://api.github.com/repos/tomakehurst/wiremock/issues/655","repository_url":"https://api.github.com/repos/tomakehurst/wiremock","labels_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/655/labels{/name}","comments_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/655/comments","events_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/655/events","html_url":"https://github.com/tomakehurst/wiremock/issues/655","id":223072340,"number":655,"title":"Trailing Forward Slash being added to Proxy URL ","user":{"login":"kobrien","id":723824,"avatar_url":"https://avatars0.githubusercontent.com/u/723824?v=3","gravatar_id":"","url":"https://api.github.com/users/kobrien","html_url":"https://github.com/kobrien","followers_url":"https://api.github.com/users/kobrien/followers","following_url":"https://api.github.com/users/kobrien/following{/other_user}","gists_url":"https://api.github.com/users/kobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/kobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kobrien/subscriptions","organizations_url":"https://api.github.com/users/kobrien/orgs","repos_url":"https://api.github.com/users/kobrien/repos","events_url":"https://api.github.com/users/kobrien/events{/privacy}","received_events_url":"https://api.github.com/users/kobrien/received_events","type":"User","site_admin":false},"labels":[{"id":415020946,"url":"https://api.github.com/repos/tomakehurst/wiremock/labels/Bug","name":"Bug","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-04-20T13:44:23Z","updated_at":"2017-05-01T14:14:41Z","closed_at":null,"body":"Hi I'm using wiremock to mock an external supplier service as part of our automated tests, However I've ran into some difficulty proxying the requests as wiremock seems to be adding a forward slash to the end of the SOAP endpoint. I was able to modify the codebase to strip any trailing slashes and it works fine.\r\n\r\nHere is an example of the slash being added to the end of the endpoint (I just made up the test endpoint for demonstration purposes)\r\n\r\n> kieran@localhost:~/workspace/gitlab/wiremockdemo/lib$ java -jar wiremock-standalone-2.6.0.jar --record-mappings --verbose --port 8888 --proxy-all=\"http://testwebservice/endpoint\"\r\n> 2017-04-20 14:36:23.807 Verbose logging enabled\r\n> SLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\r\n> SLF4J: Defaulting to no-operation (NOP) logger implementation\r\n> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\r\n> 2017-04-20 14:36:24.186 Verbose logging enabled\r\n> 2017-04-20 14:36:24.231 Recording mappings to ./mappings\r\n>  /$$      /$$ /$$                     /$$      /$$                     /$$      \r\n> | $$  /$ | $$|__/                    | $$$    /$$$                    | $$      \r\n> | $$ /$$$| $$ /$$  /$$$$$$   /$$$$$$ | $$$$  /$$$$  /$$$$$$   /$$$$$$$| $$   /$$\r\n> | $$/$$ $$ $$| $$ /$$__  $$ /$$__  $$| $$ $$/$$ $$ /$$__  $$ /$$_____/| $$  /$$/\r\n> | $$$$_  $$$$| $$| $$  \\__/| $$$$$$$$| $$  $$$| $$| $$  \\ $$| $$      | $$$$$$/ \r\n> | $$$/ \\  $$$| $$| $$      | $$_____/| $$\\  $ | $$| $$  | $$| $$      | $$_  $$ \r\n> | $$/   \\  $$| $$| $$      |  $$$$$$$| $$ \\/  | $$|  $$$$$$/|  $$$$$$$| $$ \\  $$\r\n> |__/     \\__/|__/|__/       \\_______/|__/     |__/ \\______/  \\_______/|__/  \\__/\r\n> \r\n> port:                         8888\r\n> proxy-all:                    http://testwebservice/endpoint\r\n> preserve-host-header:         false\r\n> enable-browser-proxying:      false\r\n> record-mappings:              true\r\n> match-headers:                []\r\n> no-request-journal:           false\r\n> verbose:                      true\r\n> \r\n> 2017-04-20 14:36:28.583 Proxying: POST **http://testwebservice/endpoint/**\r\n> \r\n\r\nThe \"Proxying\" message above (notice the forward slash that has been added to the end of it) was printed after I sent the following request \r\n\r\n> kieran@localhost:~$ date\r\n> Thu 20 Apr 14:36:26 IST 2017\r\n> kieran@localhost:~$ curl -X POST localhost:8888\r\n> \r\n\r\n\r\nHere is a fix that works for me, I modifed the ProxyResponseRenderer.java method to remove any forward slashes if they are present\r\n\r\n> public static HttpUriRequest getHttpRequestFor(ResponseDefinition response) {\r\n>  final RequestMethod method = response.getOriginalRequest().getMethod();\r\n>  String url = response.getProxyUrl();\r\n>  if (url.endsWith(\"/\")) {\r\n>       url = url.substring(0, url.length() - 1);\r\n>  }\r\n> \r\n>  return HttpClientFactory.getHttpRequestFor(method, url);\r\n> }\r\n"},"comment":{"url":"https://api.github.com/repos/tomakehurst/wiremock/issues/comments/298340475","html_url":"https://github.com/tomakehurst/wiremock/issues/655#issuecomment-298340475","issue_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/655","id":298340475,"user":{"login":"tomakehurst","id":707169,"avatar_url":"https://avatars0.githubusercontent.com/u/707169?v=3","gravatar_id":"","url":"https://api.github.com/users/tomakehurst","html_url":"https://github.com/tomakehurst","followers_url":"https://api.github.com/users/tomakehurst/followers","following_url":"https://api.github.com/users/tomakehurst/following{/other_user}","gists_url":"https://api.github.com/users/tomakehurst/gists{/gist_id}","starred_url":"https://api.github.com/users/tomakehurst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomakehurst/subscriptions","organizations_url":"https://api.github.com/users/tomakehurst/orgs","repos_url":"https://api.github.com/users/tomakehurst/repos","events_url":"https://api.github.com/users/tomakehurst/events{/privacy}","received_events_url":"https://api.github.com/users/tomakehurst/received_events","type":"User","site_admin":false},"created_at":"2017-05-01T14:14:41Z","updated_at":"2017-05-01T14:14:41Z","body":"That would be great, thanks."}}
{"actor":{"display_login":"tomakehurst"}}