|
@@ -1,6 +1,7 @@
|
|
package dynamicproxy
|
|
package dynamicproxy
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "fmt"
|
|
"net/http"
|
|
"net/http"
|
|
"os"
|
|
"os"
|
|
"strings"
|
|
"strings"
|
|
@@ -115,7 +116,7 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
h.proxyRequest(w, r, targetProxyEndpoint)
|
|
h.proxyRequest(w, r, targetProxyEndpoint)
|
|
} else if !strings.HasSuffix(proxyingPath, "/") {
|
|
} else if !strings.HasSuffix(proxyingPath, "/") {
|
|
potentialProxtEndpoint := h.Parent.getTargetProxyEndpointFromRequestURI(proxyingPath + "/")
|
|
potentialProxtEndpoint := h.Parent.getTargetProxyEndpointFromRequestURI(proxyingPath + "/")
|
|
-
|
|
|
|
|
|
+ fmt.Println(strings.HasSuffix(proxyingPath, "/"))
|
|
if potentialProxtEndpoint != nil {
|
|
if potentialProxtEndpoint != nil {
|
|
//Missing tailing slash. Redirect to target proxy endpoint
|
|
//Missing tailing slash. Redirect to target proxy endpoint
|
|
http.Redirect(w, r, r.RequestURI+"/", http.StatusTemporaryRedirect)
|
|
http.Redirect(w, r, r.RequestURI+"/", http.StatusTemporaryRedirect)
|