fices the UI
This commit is contained in:
parent
4bfc28a369
commit
c1f4d19975
1213 changed files with 375635 additions and 19738 deletions
45
src/Yavsc.Org/wwwroot/lib/microsoft/signalr/dist/cjs/DefaultHttpClient.js
vendored
Normal file
45
src/Yavsc.Org/wwwroot/lib/microsoft/signalr/dist/cjs/DefaultHttpClient.js
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
"use strict";
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DefaultHttpClient = void 0;
|
||||
const Errors_1 = require("./Errors");
|
||||
const FetchHttpClient_1 = require("./FetchHttpClient");
|
||||
const HttpClient_1 = require("./HttpClient");
|
||||
const Utils_1 = require("./Utils");
|
||||
const XhrHttpClient_1 = require("./XhrHttpClient");
|
||||
/** Default implementation of {@link @microsoft/signalr.HttpClient}. */
|
||||
class DefaultHttpClient extends HttpClient_1.HttpClient {
|
||||
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
||||
constructor(logger) {
|
||||
super();
|
||||
if (typeof fetch !== "undefined" || Utils_1.Platform.isNode) {
|
||||
this._httpClient = new FetchHttpClient_1.FetchHttpClient(logger);
|
||||
}
|
||||
else if (typeof XMLHttpRequest !== "undefined") {
|
||||
this._httpClient = new XhrHttpClient_1.XhrHttpClient(logger);
|
||||
}
|
||||
else {
|
||||
throw new Error("No usable HttpClient found.");
|
||||
}
|
||||
}
|
||||
/** @inheritDoc */
|
||||
send(request) {
|
||||
// Check that abort was not signaled before calling send
|
||||
if (request.abortSignal && request.abortSignal.aborted) {
|
||||
return Promise.reject(new Errors_1.AbortError());
|
||||
}
|
||||
if (!request.method) {
|
||||
return Promise.reject(new Error("No method defined."));
|
||||
}
|
||||
if (!request.url) {
|
||||
return Promise.reject(new Error("No url defined."));
|
||||
}
|
||||
return this._httpClient.send(request);
|
||||
}
|
||||
getCookieString(url) {
|
||||
return this._httpClient.getCookieString(url);
|
||||
}
|
||||
}
|
||||
exports.DefaultHttpClient = DefaultHttpClient;
|
||||
//# sourceMappingURL=DefaultHttpClient.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue