Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitb823a18

Browse files
committed
bug: fix an issue where query parameters weren't being added to the request
1 parentb04eb60 commitb823a18

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎coder-sdk/request.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ func (c Client) request(ctx context.Context, method, path string, in interface{}
2828
url=*config.BaseURLOverride
2929
}
3030

31+
url.Path=path
32+
33+
ifconfig.Query!=nil {
34+
url.RawQuery=config.Query.Encode()
35+
}
36+
3137
// If we have incoming data, encode it as json.
3238
varpayload io.Reader
3339
ifin!=nil {
@@ -39,7 +45,7 @@ func (c Client) request(ctx context.Context, method, path string, in interface{}
3945
}
4046

4147
// Create the http request.
42-
req,err:=http.NewRequestWithContext(ctx,method,url.String()+path,payload)
48+
req,err:=http.NewRequestWithContext(ctx,method,url.String(),payload)
4349
iferr!=nil {
4450
returnnil,xerrors.Errorf("create request: %w",err)
4551
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp