ignore post cmd for qr code and if empty (#2825)

This commit is contained in:
Abhishek K
2024-02-19 19:53:45 +07:00
committed by GitHub
parent 217c676ee7
commit 2d8f67db11

View File

@@ -256,13 +256,17 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
}
postUp := strings.Builder{}
for _, loc := range strings.Split(client.PostUp, "\n") {
postUp.WriteString(fmt.Sprintf("PostUp = %s\n", loc))
if client.PostUp != "" && params["type"] != "qr" {
for _, loc := range strings.Split(client.PostUp, "\n") {
postUp.WriteString(fmt.Sprintf("PostUp = %s\n", loc))
}
}
postDown := strings.Builder{}
for _, loc := range strings.Split(client.PostDown, "\n") {
postDown.WriteString(fmt.Sprintf("PostDown = %s\n", loc))
if client.PostDown != "" && params["type"] != "qr" {
for _, loc := range strings.Split(client.PostDown, "\n") {
postDown.WriteString(fmt.Sprintf("PostDown = %s\n", loc))
}
}
config := fmt.Sprintf(`[Interface]