|
@@ -209,9 +209,21 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fmt.Println(r.RequestURI)
|
|
|
+ //Clean up the request URI
|
|
|
+ proxyingPath := strings.TrimSpace(r.RequestURI)
|
|
|
+ /*
|
|
|
+ requestingRsc := filepath.Base(r.RequestURI)
|
|
|
+ if !strings.Contains(requestingRsc, ".") {
|
|
|
+ //Not a file. Add the tail slash if not exists
|
|
|
+ if proxyingPath[len(proxyingPath)-1:] != "/" {
|
|
|
+ proxyingPath = proxyingPath + "/"
|
|
|
+ http.Redirect(w, r, proxyingPath, http.StatusTemporaryRedirect)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
|
|
|
- targetProxyEndpoint := h.Parent.getTargetProxyEndpointFromRequestURI(r.RequestURI)
|
|
|
+ targetProxyEndpoint := h.Parent.getTargetProxyEndpointFromRequestURI(proxyingPath)
|
|
|
if targetProxyEndpoint != nil {
|
|
|
h.proxyRequest(w, r, targetProxyEndpoint)
|
|
|
} else {
|