From 27e12057bcd219f1d2082a3bcdee007c23544cd1 Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Sat, 4 Feb 2023 18:25:04 +0100 Subject: [PATCH] qual: use `url.JoinPath()` for constructing Kamite cmd endpoint URLs --- kamite.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kamite.go b/kamite.go index 23d9b0a..24eebdc 100644 --- a/kamite.go +++ b/kamite.go @@ -25,6 +25,7 @@ import ( "fmt" "log" "net/http" + "net/url" "github.com/gotk3/gotk3/gdk" ) @@ -166,6 +167,6 @@ func kamiteSendOCRImageCommand(port int, imgBytes []byte, w, h int) { } func kamiteMakeEndpointURL(port int, suffix string) string { - // TODO(fau): Go 1.19+ url.JoinPath() - return fmt.Sprintf(kamiteCMDEndpointBaseTpl, port) + suffix + path, _ := url.JoinPath(fmt.Sprintf(kamiteCMDEndpointBaseTpl, port), suffix) + return path }