fix: authToken handling
parent
5ab96112ea
commit
0368fb1fc3
|
@ -34,7 +34,7 @@ class EventSource extends Stream<Event> {
|
||||||
// interface attributes
|
// interface attributes
|
||||||
|
|
||||||
final Uri url;
|
final Uri url;
|
||||||
final String authToken;
|
String authToken = "";
|
||||||
|
|
||||||
EventSourceReadyState get readyState => _readyState;
|
EventSourceReadyState get readyState => _readyState;
|
||||||
|
|
||||||
|
@ -61,12 +61,14 @@ class EventSource extends Stream<Event> {
|
||||||
url = url is Uri ? url : Uri.parse(url);
|
url = url is Uri ? url : Uri.parse(url);
|
||||||
client = client ?? new http.Client();
|
client = client ?? new http.Client();
|
||||||
lastEventId = lastEventId ?? "";
|
lastEventId = lastEventId ?? "";
|
||||||
EventSource es = new EventSource._internal(url, client, lastEventId);
|
EventSource es =
|
||||||
|
new EventSource._internal(url, client, lastEventId, authToken);
|
||||||
await es._start();
|
await es._start();
|
||||||
return es;
|
return es;
|
||||||
}
|
}
|
||||||
|
|
||||||
EventSource._internal(this.url, this.client, this._lastEventId) {
|
EventSource._internal(
|
||||||
|
this.url, this.client, this._lastEventId, this.authToken) {
|
||||||
_decoder = new EventSourceDecoder(retryIndicator: _updateRetryDelay);
|
_decoder = new EventSourceDecoder(retryIndicator: _updateRetryDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue