Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit e52bd24

Browse files
authored
bug: fix an issue where query parameters weren't being added to the request (#219)
1 parent b04eb60 commit e52bd24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

coder-sdk/request.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func (c Client) request(ctx context.Context, method, path string, in interface{}
2727
if config.BaseURLOverride != nil {
2828
url = *config.BaseURLOverride
2929
}
30+
if config.Query != nil {
31+
url.RawQuery = config.Query.Encode()
32+
}
33+
34+
url.Path = path
3035

3136
// If we have incoming data, encode it as json.
3237
var payload io.Reader
@@ -39,7 +44,7 @@ func (c Client) request(ctx context.Context, method, path string, in interface{}
3944
}
4045

4146
// Create the http request.
42-
req, err := http.NewRequestWithContext(ctx, method, url.String()+path, payload)
47+
req, err := http.NewRequestWithContext(ctx, method, url.String(), payload)
4348
if err != nil {
4449
return nil, xerrors.Errorf("create request: %w", err)
4550
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy