all repos — homestead @ ca485baa487d36881484776f88628a47ebe1849c

Code for my website

fix goatcounter base URL construction

Alan Pearce
commit

ca485baa487d36881484776f88628a47ebe1849c

parent

980d1c718767b09292c6731eff111ba1edc3c53c

1 file changed, 2 insertions(+), 5 deletions(-)

jump to
M internal/stats/goatcounter/count.gointernal/stats/goatcounter/count.go
@@ -6,7 +6,6 @@ "context"
"encoding/json" "io" "net/http" - "strings" "time" "gitlab.com/tozd/go/errors"
@@ -14,7 +13,7 @@ "go.alanpearce.eu/homestead/internal/config"
"go.alanpearce.eu/x/log" ) -const timeout = 1 * time.Second +const timeout = 5 * time.Second type Options struct { URL *config.URL
@@ -48,9 +47,7 @@ }
func New(options *Options) *Goatcounter { baseURL := options.URL - if strings.HasSuffix(baseURL.Path, "/count") { - baseURL.Path = "/api/v0/" - } + baseURL.Path = "/api/v0/" return &Goatcounter{ log: options.Logger,