Parcourir la source

auto update script executed

Toby Chui il y a 2 ans
Parent
commit
dd0285e939
3 fichiers modifiés avec 14 ajouts et 3 suppressions
  1. 8 1
      mod/dynamicproxy/proxyRequestHandler.go
  2. BIN
      sys.db
  3. 6 2
      web/index.html

+ 8 - 1
mod/dynamicproxy/proxyRequestHandler.go

@@ -4,6 +4,7 @@ import (
 	"log"
 	"net/http"
 	"net/url"
+	"strings"
 
 	"imuslab.com/arozos/ReverseProxy/mod/websocketproxy"
 )
@@ -12,10 +13,16 @@ func (router *Router) getTargetProxyEndpointFromRequestURI(requestURI string) *P
 	var targetProxyEndpoint *ProxyEndpoint = nil
 	router.ProxyEndpoints.Range(func(key, value interface{}) bool {
 		rootname := key.(string)
-		if len(requestURI) >= len(rootname) && requestURI[:len(rootname)] == rootname {
+		if strings.HasPrefix(requestURI, rootname) {
 			thisProxyEndpoint := value.(*ProxyEndpoint)
 			targetProxyEndpoint = thisProxyEndpoint
 		}
+		/*
+			if len(requestURI) >= len(rootname) && requestURI[:len(rootname)] == rootname {
+				thisProxyEndpoint := value.(*ProxyEndpoint)
+				targetProxyEndpoint = thisProxyEndpoint
+			}
+		*/
 		return true
 	})
 

BIN
sys.db


+ 6 - 2
web/index.html

@@ -280,7 +280,7 @@
                         </tr>`);
                     }else if (data.length == 0){
                         $("#vdirList").append(`<tr>
-                            <td data-label="" colspan="3"><i class="question icon"></i> No Virtual Directory Record</td>
+                            <td data-label="" colspan="3"><i class="checkmark icon"></i> No Virtual Directory Record</td>
                         </tr>`);
                     }else{
                         data.forEach(vdir => {
@@ -308,7 +308,7 @@
                         </tr>`);
                     }else if (data.length == 0){
                         $("#subdList").append(`<tr>
-                            <td data-label="" colspan="3"><i class="question icon"></i> No Subdomain Proxy Record</td>
+                            <td data-label="" colspan="3"><i class="checkmark icon"></i> No Subdomain Proxy Record</td>
                         </tr>`);
                     }else{
                         data.forEach(subd => {
@@ -359,6 +359,10 @@
                             listVdirs();
                             listSubd();
                             $("#proxyaddSucc").stop().slideDown('fast').delay(3000).slideUp('fast');
+
+                            //Clear old data
+                            $("#rootname").val("");
+                            $("#proxyDomain").val("");
                         }
                     }
                 });