Skip to content

Commit

Permalink
ignore post cmd for qr code and if empty (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 authored Feb 19, 2024
1 parent 217c676 commit 2d8f67d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions controllers/ext_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2d8f67d

Please sign in to comment.