commit
92d8f854bc
|
|
@ -94,22 +94,15 @@ export class DefaultHttpClient extends HttpClient {
|
||||||
xhr.timeout = request.timeout;
|
xhr.timeout = request.timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr.onreadystatechange = () => {
|
xhr.onload = () => {
|
||||||
if (xhr.readyState === 4) {
|
if (request.abortSignal) {
|
||||||
if (request.abortSignal) {
|
request.abortSignal.onabort = null;
|
||||||
request.abortSignal.onabort = null;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Some browsers report xhr.status == 0 when the
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
// response has been cut off or there's been a TCP FIN.
|
resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));
|
||||||
// Treat it like a 200 with no response.
|
} else {
|
||||||
if (xhr.status === 0) {
|
reject(new HttpError(xhr.statusText, xhr.status));
|
||||||
resolve(new HttpResponse(200, null, null));
|
|
||||||
} else if (xhr.status >= 200 && xhr.status < 300) {
|
|
||||||
resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));
|
|
||||||
} else {
|
|
||||||
reject(new HttpError(xhr.statusText, xhr.status));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.SignalR
|
||||||
|
|
||||||
public string UserIdentifier { get; set; }
|
public string UserIdentifier { get; set; }
|
||||||
|
|
||||||
internal virtual IHubProtocol Protocol { get; set; }
|
public virtual IHubProtocol Protocol { get; internal set; }
|
||||||
|
|
||||||
internal ExceptionDispatchInfo AbortException { get; private set; }
|
internal ExceptionDispatchInfo AbortException { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue