Jelajahi Sumber

[release] v0.7.5

Yann Stepienik 2 tahun lalu
induk
melakukan
ee87be7994
2 mengubah file dengan 4 tambahan dan 11 penghapusan
  1. 1 1
      package.json
  2. 3 10
      src/utils/utils.go

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "cosmos-server",
-  "version": "0.7.4",
+  "version": "0.7.5",
   "description": "",
   "main": "test-server.js",
   "bugs": {

+ 3 - 10
src/utils/utils.go

@@ -307,15 +307,6 @@ func GetAllHostnames(applyWildCard bool, removePorts bool) []string {
 		mainHostname,
 	}
 
-	if applyWildCard && MainConfig.HTTPConfig.UseWildcardCertificate {
-		mainHostnameWild := "*." + mainHostname
-		hostnames = []string{
-			mainHostname,
-			mainHostnameWild,
-		}
-		Log("Using wildcard certificate for " + mainHostname + " and all subdomains.")
-	}
-
 	proxies := GetMainConfig().HTTPConfig.ProxyConfig.Routes
 	for _, proxy := range proxies {
 		if proxy.UseHost && proxy.Host != "" && strings.Contains(proxy.Host, ".") && !strings.Contains(proxy.Host, ",") && !strings.Contains(proxy.Host, " ") {
@@ -339,14 +330,16 @@ func GetAllHostnames(applyWildCard bool, removePorts bool) []string {
 
 	if applyWildCard && MainConfig.HTTPConfig.UseWildcardCertificate {
 		filteredHostnames := []string{
+			"*." + mainHostname,
 			mainHostname,
 		}
 
 		for _, hostname := range uniqueHostnames {
-			if hostname != mainHostname && !strings.HasSuffix(hostname, mainHostname[1:]) {
+			if hostname != mainHostname && !strings.HasSuffix(hostname, "."+mainHostname) {
 				filteredHostnames = append(filteredHostnames, hostname)
 			}
 		}
+
 		uniqueHostnames = filteredHostnames
 	}