Skip to content

Commit

Permalink
fixed health path, when url ends with trailing slash (#87)
Browse files Browse the repository at this point in the history
* fixed health path, when url ends with trailing slash

* added changelog
  • Loading branch information
AndrewChubatiuk authored Oct 14, 2024
1 parent 518eca5 commit 9701c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## tip

* BUGFIX: fix variable substitution in queries. See [this issue](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/77).
* BUGFIX: fixed health path for case, when url ends with trailing slash.

## v0.5.0

Expand Down
3 changes: 2 additions & 1 deletion pkg/plugin/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net/http"
"path"
"strings"
"sync"

Expand Down Expand Up @@ -144,7 +145,7 @@ func (d *Datasource) query(ctx context.Context, _ backend.PluginContext, query b
// datasource configuration page which allows users to verify that
// a datasource is working as expected.
func (d *Datasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) {
r, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s%s", d.settings.URL, health), nil)
r, err := http.NewRequestWithContext(ctx, http.MethodGet, path.Join(d.settings.URL, health), nil)
if err != nil {
return newHealthCheckErrorf("could not create request"), nil
}
Expand Down

0 comments on commit 9701c48

Please sign in to comment.