mirror of
https://github.com/onedr0p/exportarr.git
synced 2026-02-06 10:57:32 +00:00
fix: double slash on api requests when no urlbase is defined
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
parent
c25265681a
commit
a2a66246bd
@ -46,7 +46,7 @@ func (c *Client) DoRequest(endpoint string, target interface{}) error {
|
||||
|
||||
// Use the values from config.xml if using the config flag
|
||||
if c.config.String("config") != "" {
|
||||
url = fmt.Sprintf("%s:%s/%s/api/%s/%s",
|
||||
url = fmt.Sprintf("%s:%s%s/api/%s/%s",
|
||||
c.config.String("url"),
|
||||
c.configFile.Port,
|
||||
c.configFile.UrlBase,
|
||||
@ -90,6 +90,7 @@ func (c *Client) DoRequest(endpoint string, target interface{}) error {
|
||||
log.Fatal(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
return json.NewDecoder(resp.Body).Decode(target)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user