Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/sse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export class SSEClientTransport implements Transport {
}

private async _commonHeaders(): Promise<HeadersInit> {
const headers: HeadersInit = {};
const headers: HeadersInit = { ...this._requestInit?.headers };
if (this._authProvider) {
const tokens = await this._authProvider.tokens();
if (tokens) {
headers["Authorization"] = `Bearer ${tokens.access_token}`;
(headers as Record<string, string>)["Authorization"] = `Bearer ${tokens.access_token}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this change, like 217 can be simplified as well:

      const headers = new Headers({ ...commonHeaders, ...this._requestInit?.headers });

}
}

Expand Down