Skip to content

Commit

Permalink
fix-263: remove hardcoded /sabnzbd from api path (#275)
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Troxel <[email protected]>
  • Loading branch information
rtrox authored Mar 3, 2024
1 parent 793371b commit 8161da0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/sabnzbd/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func NewSabnzbdCollector(config *config.SabnzbdConfig) (*SabnzbdCollector, error
func (s *SabnzbdCollector) doRequest(mode string, target interface{}) error {
params := client.QueryParams{}
params.Add("mode", mode)
return s.client.DoRequest("/sabnzbd/api", target, params)
return s.client.DoRequest("/api", target, params)
}

func (s *SabnzbdCollector) getQueueStats() (*model.QueueStats, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/sabnzbd/collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func newTestServer(t *testing.T, fn func(http.ResponseWriter, *http.Request)) (*
func TestCollect(t *testing.T) {
require := require.New(t)
ts, err := newTestServer(t, func(w http.ResponseWriter, r *http.Request) {
require.Equal("/sabnzbd/api", r.URL.Path)
require.Equal("/api", r.URL.Path)
require.Equal(API_KEY, r.URL.Query().Get("apikey"))
require.Equal("json", r.URL.Query().Get("output"))
})
Expand Down

0 comments on commit 8161da0

Please sign in to comment.