Add request init headers defined on the sse transport to the start
This commit is contained in:
parent
0c4b308275
commit
d38a5979ac
1 changed files with 2 additions and 2 deletions
|
|
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue