Skip to content

Commit

Permalink
fix(stdlib): join path correctly in influxdb source (#5490)
Browse files Browse the repository at this point in the history
Update the influxdb from command to support URLs with a trailing
slash.
  • Loading branch information
mhilton authored Jun 7, 2024
1 parent 7b5a590 commit da04c3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/influxdata/influxdb/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net/http"
"net/url"
"path"

"github.com/influxdata/flux"
"github.com/influxdata/flux/ast"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit da04c3f

Please sign in to comment.