Merge pull request #538 from danielgek/add-request-init-headers-to-sse-start
Add request init headers defined on the sse transport on the start phase
This commit is contained in:
commit
df0d9c4ffc
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