From 2d8f67db11e5ea8a4b47dc64c3fe76a824c187ae Mon Sep 17 00:00:00 2001 From: Abhishek K <32607604+abhishek9686@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:53:45 +0700 Subject: [PATCH] ignore post cmd for qr code and if empty (#2825) --- controllers/ext_client.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/ext_client.go b/controllers/ext_client.go index 5ca7c6979..a95d5700c 100644 --- a/controllers/ext_client.go +++ b/controllers/ext_client.go @@ -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]