diff --git a/endpoints.go b/endpoints.go index ccc3ae9..0a494f0 100644 --- a/endpoints.go +++ b/endpoints.go @@ -15,15 +15,16 @@ package main import ( - "github.com/go-chi/chi/v5" "io" "net" "net/http" "time" + + "github.com/go-chi/chi/v5" ) func ip(w http.ResponseWriter, r *http.Request) { - ip := request_ip(r) + ip := request_ip(r) + "\n" w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Content-Type", "text/plain") diff --git a/telize.go b/telize.go index a1f7818..fc3622f 100644 --- a/telize.go +++ b/telize.go @@ -17,11 +17,12 @@ package main import ( "flag" "fmt" - "github.com/go-chi/chi/v5" - "github.com/oschwald/maxminddb-golang" "log" "net/http" "os" + + "github.com/go-chi/chi/v5" + "github.com/oschwald/maxminddb-golang" ) var asn *maxminddb.Reader diff --git a/utils.go b/utils.go index ba8942b..a9628c7 100644 --- a/utils.go +++ b/utils.go @@ -63,9 +63,9 @@ func jsonify(w http.ResponseWriter, r *http.Request, payload *payload) { if json, err := json.Marshal(payload); err == nil { if callback != "" { - io.WriteString(w, callback+"("+string(json)+");") + io.WriteString(w, callback+"("+string(json)+");\n") } else { - io.WriteString(w, string(json)) + io.WriteString(w, string(json)+"\n") } } }