Skip to content

Commit 68f3b02

Browse files
authored
Allow initiating client without authentication (#75)
* Allow initiating client without authentication * Don't set Authorization header at all * Revert test case
1 parent 56cbaa0 commit 68f3b02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ export class Client {
275275
public async sendRequest(request: AxiosRequestConfig, callback?: Callback): Promise<any> {
276276
try {
277277
request.headers = request.headers || {};
278-
request.headers.Authorization = request.headers.Authorization || getAuthentication(this.config, request);
278+
279+
const authorization = request.headers.Authorization || getAuthentication(this.config, request);
280+
281+
if (!!authorization) {
282+
request.headers.Authorization = authorization;
283+
}
279284

280285
const response = await this.requestInstance.request(request);
281286

0 commit comments

Comments
 (0)