Skip to content

Commit d9e3972

Browse files
committed
Explain when to use getAuthorizationHeaderFor
1 parent 1c350b1 commit d9e3972

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/api-client.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@ export class InstanceApiClient {
146146
}
147147

148148
/**
149-
* Gets a value for the `Authorization` header for a request to `url`; or `undefined` if the
150-
* `Authorization` header should not be set for `url`.
149+
* In most cases, we use an {@link ApiClient} which automatically handles auth for requests
150+
* made with it and this method is not needed and should not be used in that setting.
151+
*
152+
* In some cases, we need to make requests that can't go through an {@link ApiClient}, but still
153+
* require auth. For example, this is the case when using the `toolcache` module to download
154+
* files. For these cases, this method gets a value for the `Authorization` header for a request
155+
* to `url`; or `undefined` if the `Authorization` header should not be set for `url`.
151156
*
152157
* @param logger The logger to use for debugging messages.
153158
* @param url The URL for which we want to add an `Authorization` header.

0 commit comments

Comments
 (0)