Merge pull request #2077 from aspnet/release/2.1

Merge Release/2.1
This commit is contained in:
Mikael Mengistu 2018-04-18 18:58:54 +00:00 committed by GitHub
commit 92d8f854bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 16 deletions

View File

@ -94,22 +94,15 @@ export class DefaultHttpClient extends HttpClient {
xhr.timeout = request.timeout;
}
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (request.abortSignal) {
request.abortSignal.onabort = null;
}
xhr.onload = () => {
if (request.abortSignal) {
request.abortSignal.onabort = null;
}
// Some browsers report xhr.status == 0 when the
// response has been cut off or there's been a TCP FIN.
// Treat it like a 200 with no response.
if (xhr.status === 0) {
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));
}
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));
}
};

View File

@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.SignalR
public string UserIdentifier { get; set; }
internal virtual IHubProtocol Protocol { get; set; }
public virtual IHubProtocol Protocol { get; internal set; }
internal ExceptionDispatchInfo AbortException { get; private set; }