From 744837b9c7dcf23dc37183d61cffa7cb798aa074 Mon Sep 17 00:00:00 2001 From: Kalle Carlbark Date: Sat, 27 Nov 2021 23:57:14 +0100 Subject: [PATCH] Fix URL in new request in special FetchSessionKey --- netbox.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox.go b/netbox.go index 2aa59c5..c9a2eca 100644 --- a/netbox.go +++ b/netbox.go @@ -199,7 +199,7 @@ func (c *Client) FetchSessionKey(privatekey string) error { query := form.Encode() ctx := context.Background() - req, err := http.NewRequestWithContext(ctx, "POST", secretsPath+"/get-session-key/", strings.NewReader(query)) + req, err := http.NewRequestWithContext(ctx, "POST", c.baseURL.String()+secretsPath+"/get-session-key/", strings.NewReader(query)) if err != nil { return err }