Remove extra spaces in commands

This commit is contained in:
Lan Tian
2020-05-17 22:11:34 +08:00
parent b83c12224f
commit 4df9006c81
3 changed files with 4 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"os/exec"
"runtime"
"strings"
)
// Wrapper of traceroute, IPv4
@@ -33,6 +34,7 @@ func tracerouteTryExecute(cmd []string, args [][]string) ([]byte, error) {
// Real handler of traceroute requests
func tracerouteRealHandler(useIPv6 bool, httpW http.ResponseWriter, httpR *http.Request) {
query := string(httpR.URL.Query().Get("q"))
query = strings.TrimSpace(query)
if query == "" {
invalidHandler(httpW, httpR)
} else {