Skip to content

Commit bb02ae4

Browse files
committed
ignore post cmd for qr code and if empty
1 parent 217c676 commit bb02ae4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

controllers/ext_client.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,17 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
256256
}
257257

258258
postUp := strings.Builder{}
259-
for _, loc := range strings.Split(client.PostUp, "\n") {
260-
postUp.WriteString(fmt.Sprintf("PostUp = %s\n", loc))
259+
if client.PostUp != "" && params["type"] != "qr" {
260+
for _, loc := range strings.Split(client.PostUp, "\n") {
261+
postUp.WriteString(fmt.Sprintf("PostUp = %s\n", loc))
262+
}
261263
}
262264

263265
postDown := strings.Builder{}
264-
for _, loc := range strings.Split(client.PostDown, "\n") {
265-
postDown.WriteString(fmt.Sprintf("PostDown = %s\n", loc))
266+
if client.PostDown != "" && params["type"] != "qr" {
267+
for _, loc := range strings.Split(client.PostDown, "\n") {
268+
postDown.WriteString(fmt.Sprintf("PostDown = %s\n", loc))
269+
}
266270
}
267271

268272
config := fmt.Sprintf(`[Interface]

0 commit comments

Comments
 (0)