From da04c3f0fab9eda235a2a7c3522348e1b3941aaf Mon Sep 17 00:00:00 2001 From: Martin Hilton Date: Fri, 7 Jun 2024 12:09:07 +0100 Subject: [PATCH] fix(stdlib): join path correctly in influxdb source (#5490) Update the influxdb from command to support URLs with a trailing slash. --- stdlib/influxdata/influxdb/source.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/influxdata/influxdb/source.go b/stdlib/influxdata/influxdb/source.go index ef3ca27fff..4e2a815e6a 100644 --- a/stdlib/influxdata/influxdb/source.go +++ b/stdlib/influxdata/influxdb/source.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "net/url" + "path" "github.com/influxdata/flux" "github.com/influxdata/flux/ast" @@ -111,7 +112,7 @@ func (s *source) newRequest(ctx context.Context) (*http.Request, error) { if err != nil { return nil, err } - u.Path += "/api/v2/query" + u.Path = path.Join(u.Path, "/api/v2/query") if org := s.spec.GetOrg(); org != nil { u.RawQuery = func() string { params := make(url.Values)