fix: clear UPNP port mapping when exist app (#624)

This commit is contained in:
Levi authored and GitHub committed 2024-07-30 18:43:54 +08:00
1 parent 3b50465708
commit 4fbe13a1f0
22 files changed
+506 -320

No files matched your search

+1 -7
View File
@@ -8,18 +8,13 @@ import (
"strings"
)
const FileSchema = "FILE"
func ParseSchema(url string) string {
index := strings.Index(url, ":")
// if no schema or windows path like C:\a.txt, return FILE
if index == -1 || index == 1 {
return FileSchema
return ""
}
schema := url[:index]
if schema == "data" {
schema, _ = ParseDataUri(url)
}
return strings.ToUpper(schema)
}
@@ -32,7 +27,6 @@ func ParseDataUri(uri string) (string, []byte) {
}
mime := matches[1]
base64Data := matches[2]
// 解码Base64数据
data, err := base64.StdEncoding.DecodeString(base64Data)
if err != nil {
return "", nil