From 2330049834abf8ff766a03786ff01309613645f1 Mon Sep 17 00:00:00 2001 From: "kieran.obrien" Date: Tue, 2 May 2017 10:01:39 +0100 Subject: [PATCH] Issue #655 - Added check to remove trailing forward slash if found in proxy URL --- .../tomakehurst/wiremock/http/ProxyResponseRenderer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/tomakehurst/wiremock/http/ProxyResponseRenderer.java b/src/main/java/com/github/tomakehurst/wiremock/http/ProxyResponseRenderer.java index ea554b6b0e..6ab26308b4 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/http/ProxyResponseRenderer.java +++ b/src/main/java/com/github/tomakehurst/wiremock/http/ProxyResponseRenderer.java @@ -95,7 +95,10 @@ private HttpHeaders headersFrom(HttpResponse httpResponse, ResponseDefinition re public static HttpUriRequest getHttpRequestFor(ResponseDefinition response) { final RequestMethod method = response.getOriginalRequest().getMethod(); - final String url = response.getProxyUrl(); + String url = response.getProxyUrl(); + if (url.endsWith("/")) { + url = url.substring(0, url.length() - 1); + } return HttpClientFactory.getHttpRequestFor(method, url); }