Skip to content

Commit 53e1b76

Browse files
committed
rename to RequestWithoutSessionToken
1 parent d9ee61f commit 53e1b76

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, path string, body interface{}, opts ...RequestOption) (*http.Response, error) {
204204
opts = append([]RequestOption{c.SessionTokenProvider.AsRequestOption()}, opts...)
205-
return c.RequestNoSessionToken(ctx, method, path, body, opts...)
205+
return c.RequestWithoutSessionToken(ctx, method, path, body, opts...)
206206
}
207207

208-
func (c *Client) RequestNoSessionToken(ctx context.Context, method, path string, body interface{}, 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, path string, body interface{}, opts ...RequestOption) (*http.Response, error) {
209212
if ctx == nil {
210213
return nil, xerrors.Errorf("context should not be nil")
211214
}

0 commit comments

Comments
 (0)