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

Commit0323ac1

Browse files
committed
rename to RequestWithoutSessionToken
1 parent3dca095 commit0323ac1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎codersdk/client.go‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,13 @@ func prefixLines(prefix, s []byte) []byte {
202202
// responsible for closing the response body.
203203
func (c*Client)Request(ctx context.Context,method,pathstring,bodyinterface{},opts...RequestOption) (*http.Response,error) {
204204
opts=append([]RequestOption{c.SessionTokenProvider.AsRequestOption()},opts...)
205-
returnc.RequestNoSessionToken(ctx,method,path,body,opts...)
205+
returnc.RequestWithoutSessionToken(ctx,method,path,body,opts...)
206206
}
207207

208-
func (c*Client)RequestNoSessionToken(ctx context.Context,method,pathstring,bodyinterface{},opts...RequestOption) (*http.Response,error) {
208+
// RequestWithoutSessionToken performs a HTTP request. It is similar to Request, but does not set
209+
// the session token in the request header, nor does it make a call to the SessionTokenProvider.
210+
// This allows session token providers to call this method without causing reentrancy issues.
211+
func (c*Client)RequestWithoutSessionToken(ctx context.Context,method,pathstring,bodyinterface{},opts...RequestOption) (*http.Response,error) {
209212
ifctx==nil {
210213
returnnil,xerrors.Errorf("context should not be nil")
211214
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp