@angular/common 16.0.0-rc.4 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/http/src/client.mjs +3 -3
- package/esm2022/http/src/interceptor.mjs +3 -3
- package/esm2022/http/src/jsonp.mjs +10 -10
- package/esm2022/http/src/module.mjs +12 -12
- package/esm2022/http/src/provider.mjs +16 -16
- package/esm2022/http/src/xhr.mjs +245 -234
- package/esm2022/http/src/xsrf.mjs +6 -6
- package/esm2022/http/testing/src/backend.mjs +3 -3
- package/esm2022/http/testing/src/module.mjs +4 -4
- package/esm2022/src/common_module.mjs +4 -4
- package/esm2022/src/directives/ng_class.mjs +3 -3
- package/esm2022/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2022/src/directives/ng_for_of.mjs +3 -3
- package/esm2022/src/directives/ng_if.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/preconnect_link_checker.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/preload-link-creator.mjs +3 -3
- package/esm2022/src/directives/ng_plural.mjs +6 -6
- package/esm2022/src/directives/ng_style.mjs +3 -3
- package/esm2022/src/directives/ng_switch.mjs +9 -9
- package/esm2022/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2022/src/i18n/localization.mjs +6 -6
- package/esm2022/src/location/hash_location_strategy.mjs +3 -3
- package/esm2022/src/location/location.mjs +3 -3
- package/esm2022/src/location/location_strategy.mjs +6 -6
- package/esm2022/src/location/platform_location.mjs +15 -42
- package/esm2022/src/pipes/async_pipe.mjs +3 -3
- package/esm2022/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2022/src/pipes/date_pipe.mjs +3 -3
- package/esm2022/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2022/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2022/src/pipes/json_pipe.mjs +3 -3
- package/esm2022/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2022/src/pipes/number_pipe.mjs +9 -9
- package/esm2022/src/pipes/slice_pipe.mjs +3 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/location_mock.mjs +3 -3
- package/esm2022/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2022/testing/src/mock_platform_location.mjs +3 -3
- package/esm2022/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2022/common.mjs +122 -149
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +8 -8
- package/fesm2022/http.mjs +293 -283
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +10 -10
- package/fesm2022/upgrade.mjs +5 -5
- package/http/index.d.ts +21 -21
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +3 -3
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2022/http.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.
|
|
2
|
+
* @license Angular v16.0.1
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { Injectable, InjectionToken, inject, Inject, PLATFORM_ID, makeEnvironmentProviders, NgModule, TransferState, makeStateKey, ɵENABLED_SSR_FEATURES, APP_BOOTSTRAP_LISTENER, ApplicationRef, ɵInitialRenderPendingTasks } from '@angular/core';
|
|
9
|
-
import { of, Observable } from 'rxjs';
|
|
10
|
-
import { concatMap, filter, map, tap, first } from 'rxjs/operators';
|
|
9
|
+
import { of, Observable, from } from 'rxjs';
|
|
10
|
+
import { concatMap, filter, map, switchMap, tap, first } from 'rxjs/operators';
|
|
11
11
|
import * as i1 from '@angular/common';
|
|
12
12
|
import { DOCUMENT, ɵparseCookieValue } from '@angular/common';
|
|
13
13
|
|
|
@@ -1371,10 +1371,10 @@ class HttpClient {
|
|
|
1371
1371
|
put(url, body, options = {}) {
|
|
1372
1372
|
return this.request('PUT', url, addBody(options, body));
|
|
1373
1373
|
}
|
|
1374
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
1375
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
1374
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1375
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClient }); }
|
|
1376
1376
|
}
|
|
1377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
1377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClient, decorators: [{
|
|
1378
1378
|
type: Injectable
|
|
1379
1379
|
}], ctorParameters: function () { return [{ type: HttpHandler }]; } });
|
|
1380
1380
|
|
|
@@ -1453,10 +1453,10 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest));
|
|
1455
1455
|
}
|
|
1456
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
1457
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
1456
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1457
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpInterceptorHandler }); }
|
|
1458
1458
|
}
|
|
1459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
1459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1460
1460
|
type: Injectable
|
|
1461
1461
|
}], ctorParameters: function () { return [{ type: HttpBackend }, { type: i0.EnvironmentInjector }]; } });
|
|
1462
1462
|
|
|
@@ -1506,8 +1506,8 @@ function jsonpCallbackContext() {
|
|
|
1506
1506
|
/**
|
|
1507
1507
|
* Processes an `HttpRequest` with the JSONP method,
|
|
1508
1508
|
* by performing JSONP style requests.
|
|
1509
|
-
* @see
|
|
1510
|
-
* @see
|
|
1509
|
+
* @see {@link HttpHandler}
|
|
1510
|
+
* @see {@link HttpXhrBackend}
|
|
1511
1511
|
*
|
|
1512
1512
|
* @publicApi
|
|
1513
1513
|
*/
|
|
@@ -1658,10 +1658,10 @@ class JsonpClientBackend {
|
|
|
1658
1658
|
}
|
|
1659
1659
|
foreignDocument.adoptNode(script);
|
|
1660
1660
|
}
|
|
1661
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
1662
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
1661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1662
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpClientBackend }); }
|
|
1663
1663
|
}
|
|
1664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
1664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
1665
1665
|
type: Injectable
|
|
1666
1666
|
}], ctorParameters: function () { return [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
1667
1667
|
type: Inject,
|
|
@@ -1681,7 +1681,7 @@ function jsonpInterceptorFn(req, next) {
|
|
|
1681
1681
|
* Identifies requests with the method JSONP and
|
|
1682
1682
|
* shifts them to the `JsonpClientBackend`.
|
|
1683
1683
|
*
|
|
1684
|
-
* @see
|
|
1684
|
+
* @see {@link HttpInterceptor}
|
|
1685
1685
|
*
|
|
1686
1686
|
* @publicApi
|
|
1687
1687
|
*/
|
|
@@ -1699,10 +1699,10 @@ class JsonpInterceptor {
|
|
|
1699
1699
|
intercept(initialRequest, next) {
|
|
1700
1700
|
return this.injector.runInContext(() => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
1701
1701
|
}
|
|
1702
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
1703
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
1702
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1703
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpInterceptor }); }
|
|
1704
1704
|
}
|
|
1705
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
1705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
1706
1706
|
type: Injectable
|
|
1707
1707
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
1708
1708
|
|
|
@@ -1722,8 +1722,8 @@ function getResponseUrl(xhr) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
/**
|
|
1724
1724
|
* Uses `XMLHttpRequest` to send requests to a backend server.
|
|
1725
|
-
* @see
|
|
1726
|
-
* @see
|
|
1725
|
+
* @see {@link HttpHandler}
|
|
1726
|
+
* @see {@link JsonpClientBackend}
|
|
1727
1727
|
*
|
|
1728
1728
|
* @publicApi
|
|
1729
1729
|
*/
|
|
@@ -1742,252 +1742,262 @@ class HttpXhrBackend {
|
|
|
1742
1742
|
if (req.method === 'JSONP') {
|
|
1743
1743
|
throw new Error(`Attempted to construct Jsonp request without HttpClientJsonpModule installed.`);
|
|
1744
1744
|
}
|
|
1745
|
-
//
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
// Auto-detect the Content-Type header if one isn't present already.
|
|
1760
|
-
if (!req.headers.has('Content-Type')) {
|
|
1761
|
-
const detectedType = req.detectContentTypeHeader();
|
|
1762
|
-
// Sometimes Content-Type detection fails.
|
|
1763
|
-
if (detectedType !== null) {
|
|
1764
|
-
xhr.setRequestHeader('Content-Type', detectedType);
|
|
1745
|
+
// Check whether this factory has a special function to load an XHR implementation
|
|
1746
|
+
// for various non-browser environments. We currently limit it to only `ServerXhr`
|
|
1747
|
+
// class, which needs to load an XHR implementation.
|
|
1748
|
+
const xhrFactory = this.xhrFactory;
|
|
1749
|
+
const source = xhrFactory.ɵloadImpl ? from(xhrFactory.ɵloadImpl()) : of(null);
|
|
1750
|
+
return source.pipe(switchMap(() => {
|
|
1751
|
+
// Everything happens on Observable subscription.
|
|
1752
|
+
return new Observable((observer) => {
|
|
1753
|
+
// Start by setting up the XHR object with request method, URL, and withCredentials
|
|
1754
|
+
// flag.
|
|
1755
|
+
const xhr = xhrFactory.build();
|
|
1756
|
+
xhr.open(req.method, req.urlWithParams);
|
|
1757
|
+
if (req.withCredentials) {
|
|
1758
|
+
xhr.withCredentials = true;
|
|
1765
1759
|
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
// returns an XSSI-prefixed JSON response, the browser will fail to parse it,
|
|
1772
|
-
// xhr.response will be null, and xhr.responseText cannot be accessed to
|
|
1773
|
-
// retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON
|
|
1774
|
-
// is parsed by first requesting text and then applying JSON.parse.
|
|
1775
|
-
xhr.responseType = ((responseType !== 'json') ? responseType : 'text');
|
|
1776
|
-
}
|
|
1777
|
-
// Serialize the request body if one is present. If not, this will be set to null.
|
|
1778
|
-
const reqBody = req.serializeBody();
|
|
1779
|
-
// If progress events are enabled, response headers will be delivered
|
|
1780
|
-
// in two events - the HttpHeaderResponse event and the full HttpResponse
|
|
1781
|
-
// event. However, since response headers don't change in between these
|
|
1782
|
-
// two events, it doesn't make sense to parse them twice. So headerResponse
|
|
1783
|
-
// caches the data extracted from the response whenever it's first parsed,
|
|
1784
|
-
// to ensure parsing isn't duplicated.
|
|
1785
|
-
let headerResponse = null;
|
|
1786
|
-
// partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest
|
|
1787
|
-
// state, and memoizes it into headerResponse.
|
|
1788
|
-
const partialFromXhr = () => {
|
|
1789
|
-
if (headerResponse !== null) {
|
|
1790
|
-
return headerResponse;
|
|
1760
|
+
// Add all the requested headers.
|
|
1761
|
+
req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(',')));
|
|
1762
|
+
// Add an Accept header if one isn't present already.
|
|
1763
|
+
if (!req.headers.has('Accept')) {
|
|
1764
|
+
xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');
|
|
1791
1765
|
}
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
headerResponse = new HttpHeaderResponse({ headers, status: xhr.status, statusText, url });
|
|
1800
|
-
return headerResponse;
|
|
1801
|
-
};
|
|
1802
|
-
// Next, a few closures are defined for the various events which XMLHttpRequest can
|
|
1803
|
-
// emit. This allows them to be unregistered as event listeners later.
|
|
1804
|
-
// First up is the load event, which represents a response being fully available.
|
|
1805
|
-
const onLoad = () => {
|
|
1806
|
-
// Read response state from the memoized partial data.
|
|
1807
|
-
let { headers, status, statusText, url } = partialFromXhr();
|
|
1808
|
-
// The body will be read out if present.
|
|
1809
|
-
let body = null;
|
|
1810
|
-
if (status !== 204 /* HttpStatusCode.NoContent */) {
|
|
1811
|
-
// Use XMLHttpRequest.response if set, responseText otherwise.
|
|
1812
|
-
body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;
|
|
1766
|
+
// Auto-detect the Content-Type header if one isn't present already.
|
|
1767
|
+
if (!req.headers.has('Content-Type')) {
|
|
1768
|
+
const detectedType = req.detectContentTypeHeader();
|
|
1769
|
+
// Sometimes Content-Type detection fails.
|
|
1770
|
+
if (detectedType !== null) {
|
|
1771
|
+
xhr.setRequestHeader('Content-Type', detectedType);
|
|
1772
|
+
}
|
|
1813
1773
|
}
|
|
1814
|
-
//
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
1774
|
+
// Set the responseType if one was requested.
|
|
1775
|
+
if (req.responseType) {
|
|
1776
|
+
const responseType = req.responseType.toLowerCase();
|
|
1777
|
+
// JSON responses need to be processed as text. This is because if the server
|
|
1778
|
+
// returns an XSSI-prefixed JSON response, the browser will fail to parse it,
|
|
1779
|
+
// xhr.response will be null, and xhr.responseText cannot be accessed to
|
|
1780
|
+
// retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON
|
|
1781
|
+
// is parsed by first requesting text and then applying JSON.parse.
|
|
1782
|
+
xhr.responseType = ((responseType !== 'json') ? responseType : 'text');
|
|
1817
1783
|
}
|
|
1818
|
-
//
|
|
1819
|
-
|
|
1820
|
-
//
|
|
1821
|
-
//
|
|
1822
|
-
|
|
1823
|
-
//
|
|
1824
|
-
//
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1784
|
+
// Serialize the request body if one is present. If not, this will be set to null.
|
|
1785
|
+
const reqBody = req.serializeBody();
|
|
1786
|
+
// If progress events are enabled, response headers will be delivered
|
|
1787
|
+
// in two events - the HttpHeaderResponse event and the full HttpResponse
|
|
1788
|
+
// event. However, since response headers don't change in between these
|
|
1789
|
+
// two events, it doesn't make sense to parse them twice. So headerResponse
|
|
1790
|
+
// caches the data extracted from the response whenever it's first parsed,
|
|
1791
|
+
// to ensure parsing isn't duplicated.
|
|
1792
|
+
let headerResponse = null;
|
|
1793
|
+
// partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest
|
|
1794
|
+
// state, and memoizes it into headerResponse.
|
|
1795
|
+
const partialFromXhr = () => {
|
|
1796
|
+
if (headerResponse !== null) {
|
|
1797
|
+
return headerResponse;
|
|
1832
1798
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1799
|
+
const statusText = xhr.statusText || 'OK';
|
|
1800
|
+
// Parse headers from XMLHttpRequest - this step is lazy.
|
|
1801
|
+
const headers = new HttpHeaders(xhr.getAllResponseHeaders());
|
|
1802
|
+
// Read the response URL from the XMLHttpResponse instance and fall back on the
|
|
1803
|
+
// request URL.
|
|
1804
|
+
const url = getResponseUrl(xhr) || req.url;
|
|
1805
|
+
// Construct the HttpHeaderResponse and memoize it.
|
|
1806
|
+
headerResponse =
|
|
1807
|
+
new HttpHeaderResponse({ headers, status: xhr.status, statusText, url });
|
|
1808
|
+
return headerResponse;
|
|
1809
|
+
};
|
|
1810
|
+
// Next, a few closures are defined for the various events which XMLHttpRequest can
|
|
1811
|
+
// emit. This allows them to be unregistered as event listeners later.
|
|
1812
|
+
// First up is the load event, which represents a response being fully available.
|
|
1813
|
+
const onLoad = () => {
|
|
1814
|
+
// Read response state from the memoized partial data.
|
|
1815
|
+
let { headers, status, statusText, url } = partialFromXhr();
|
|
1816
|
+
// The body will be read out if present.
|
|
1817
|
+
let body = null;
|
|
1818
|
+
if (status !== 204 /* HttpStatusCode.NoContent */) {
|
|
1819
|
+
// Use XMLHttpRequest.response if set, responseText otherwise.
|
|
1820
|
+
body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;
|
|
1821
|
+
}
|
|
1822
|
+
// Normalize another potential bug (this one comes from CORS).
|
|
1823
|
+
if (status === 0) {
|
|
1824
|
+
status = !!body ? 200 /* HttpStatusCode.Ok */ : 0;
|
|
1825
|
+
}
|
|
1826
|
+
// ok determines whether the response will be transmitted on the event or
|
|
1827
|
+
// error channel. Unsuccessful status codes (not 2xx) will always be errors,
|
|
1828
|
+
// but a successful status code can still result in an error if the user
|
|
1829
|
+
// asked for JSON data and the body cannot be parsed as such.
|
|
1830
|
+
let ok = status >= 200 && status < 300;
|
|
1831
|
+
// Check whether the body needs to be parsed as JSON (in many cases the browser
|
|
1832
|
+
// will have done that already).
|
|
1833
|
+
if (req.responseType === 'json' && typeof body === 'string') {
|
|
1834
|
+
// Save the original body, before attempting XSSI prefix stripping.
|
|
1835
|
+
const originalBody = body;
|
|
1836
|
+
body = body.replace(XSSI_PREFIX, '');
|
|
1837
|
+
try {
|
|
1838
|
+
// Attempt the parse. If it fails, a parse error should be delivered to the
|
|
1839
|
+
// user.
|
|
1840
|
+
body = body !== '' ? JSON.parse(body) : null;
|
|
1841
|
+
}
|
|
1842
|
+
catch (error) {
|
|
1843
|
+
// Since the JSON.parse failed, it's reasonable to assume this might not have
|
|
1844
|
+
// been a JSON response. Restore the original body (including any XSSI prefix)
|
|
1845
|
+
// to deliver a better error response.
|
|
1846
|
+
body = originalBody;
|
|
1847
|
+
// If this was an error request to begin with, leave it as a string, it
|
|
1848
|
+
// probably just isn't JSON. Otherwise, deliver the parsing error to the user.
|
|
1849
|
+
if (ok) {
|
|
1850
|
+
// Even though the response status was 2xx, this is still an error.
|
|
1851
|
+
ok = false;
|
|
1852
|
+
// The parse error contains the text of the body that failed to parse.
|
|
1853
|
+
body = { error, text: body };
|
|
1854
|
+
}
|
|
1845
1855
|
}
|
|
1846
1856
|
}
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1857
|
+
if (ok) {
|
|
1858
|
+
// A successful response is delivered on the event stream.
|
|
1859
|
+
observer.next(new HttpResponse({
|
|
1860
|
+
body,
|
|
1861
|
+
headers,
|
|
1862
|
+
status,
|
|
1863
|
+
statusText,
|
|
1864
|
+
url: url || undefined,
|
|
1865
|
+
}));
|
|
1866
|
+
// The full body has been received and delivered, no further events
|
|
1867
|
+
// are possible. This request is complete.
|
|
1868
|
+
observer.complete();
|
|
1869
|
+
}
|
|
1870
|
+
else {
|
|
1871
|
+
// An unsuccessful request is delivered on the error channel.
|
|
1872
|
+
observer.error(new HttpErrorResponse({
|
|
1873
|
+
// The error in this case is the response body (error from the server).
|
|
1874
|
+
error: body,
|
|
1875
|
+
headers,
|
|
1876
|
+
status,
|
|
1877
|
+
statusText,
|
|
1878
|
+
url: url || undefined,
|
|
1879
|
+
}));
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
// The onError callback is called when something goes wrong at the network level.
|
|
1883
|
+
// Connection timeout, DNS error, offline, etc. These are actual errors, and are
|
|
1884
|
+
// transmitted on the error channel.
|
|
1885
|
+
const onError = (error) => {
|
|
1886
|
+
const { url } = partialFromXhr();
|
|
1887
|
+
const res = new HttpErrorResponse({
|
|
1888
|
+
error,
|
|
1889
|
+
status: xhr.status || 0,
|
|
1890
|
+
statusText: xhr.statusText || 'Unknown Error',
|
|
1869
1891
|
url: url || undefined,
|
|
1870
|
-
})
|
|
1871
|
-
|
|
1872
|
-
};
|
|
1873
|
-
// The onError callback is called when something goes wrong at the network level.
|
|
1874
|
-
// Connection timeout, DNS error, offline, etc. These are actual errors, and are
|
|
1875
|
-
// transmitted on the error channel.
|
|
1876
|
-
const onError = (error) => {
|
|
1877
|
-
const { url } = partialFromXhr();
|
|
1878
|
-
const res = new HttpErrorResponse({
|
|
1879
|
-
error,
|
|
1880
|
-
status: xhr.status || 0,
|
|
1881
|
-
statusText: xhr.statusText || 'Unknown Error',
|
|
1882
|
-
url: url || undefined,
|
|
1883
|
-
});
|
|
1884
|
-
observer.error(res);
|
|
1885
|
-
};
|
|
1886
|
-
// The sentHeaders flag tracks whether the HttpResponseHeaders event
|
|
1887
|
-
// has been sent on the stream. This is necessary to track if progress
|
|
1888
|
-
// is enabled since the event will be sent on only the first download
|
|
1889
|
-
// progress event.
|
|
1890
|
-
let sentHeaders = false;
|
|
1891
|
-
// The download progress event handler, which is only registered if
|
|
1892
|
-
// progress events are enabled.
|
|
1893
|
-
const onDownProgress = (event) => {
|
|
1894
|
-
// Send the HttpResponseHeaders event if it hasn't been sent already.
|
|
1895
|
-
if (!sentHeaders) {
|
|
1896
|
-
observer.next(partialFromXhr());
|
|
1897
|
-
sentHeaders = true;
|
|
1898
|
-
}
|
|
1899
|
-
// Start building the download progress event to deliver on the response
|
|
1900
|
-
// event stream.
|
|
1901
|
-
let progressEvent = {
|
|
1902
|
-
type: HttpEventType.DownloadProgress,
|
|
1903
|
-
loaded: event.loaded,
|
|
1892
|
+
});
|
|
1893
|
+
observer.error(res);
|
|
1904
1894
|
};
|
|
1905
|
-
//
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
//
|
|
1911
|
-
//
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1895
|
+
// The sentHeaders flag tracks whether the HttpResponseHeaders event
|
|
1896
|
+
// has been sent on the stream. This is necessary to track if progress
|
|
1897
|
+
// is enabled since the event will be sent on only the first download
|
|
1898
|
+
// progress event.
|
|
1899
|
+
let sentHeaders = false;
|
|
1900
|
+
// The download progress event handler, which is only registered if
|
|
1901
|
+
// progress events are enabled.
|
|
1902
|
+
const onDownProgress = (event) => {
|
|
1903
|
+
// Send the HttpResponseHeaders event if it hasn't been sent already.
|
|
1904
|
+
if (!sentHeaders) {
|
|
1905
|
+
observer.next(partialFromXhr());
|
|
1906
|
+
sentHeaders = true;
|
|
1907
|
+
}
|
|
1908
|
+
// Start building the download progress event to deliver on the response
|
|
1909
|
+
// event stream.
|
|
1910
|
+
let progressEvent = {
|
|
1911
|
+
type: HttpEventType.DownloadProgress,
|
|
1912
|
+
loaded: event.loaded,
|
|
1913
|
+
};
|
|
1914
|
+
// Set the total number of bytes in the event if it's available.
|
|
1915
|
+
if (event.lengthComputable) {
|
|
1916
|
+
progressEvent.total = event.total;
|
|
1917
|
+
}
|
|
1918
|
+
// If the request was for text content and a partial response is
|
|
1919
|
+
// available on XMLHttpRequest, include it in the progress event
|
|
1920
|
+
// to allow for streaming reads.
|
|
1921
|
+
if (req.responseType === 'text' && !!xhr.responseText) {
|
|
1922
|
+
progressEvent.partialText = xhr.responseText;
|
|
1923
|
+
}
|
|
1924
|
+
// Finally, fire the event.
|
|
1925
|
+
observer.next(progressEvent);
|
|
1926
1926
|
};
|
|
1927
|
-
//
|
|
1928
|
-
//
|
|
1929
|
-
|
|
1930
|
-
progress.
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
//
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
/** Tear down logic to cancel the backround macrotask. */
|
|
1951
|
-
const onLoadStart = () => {
|
|
1952
|
-
macroTaskCanceller ??= createBackgroundMacroTask();
|
|
1953
|
-
};
|
|
1954
|
-
const onLoadEnd = () => {
|
|
1955
|
-
macroTaskCanceller?.();
|
|
1956
|
-
};
|
|
1957
|
-
xhr.addEventListener('loadstart', onLoadStart);
|
|
1958
|
-
xhr.addEventListener('loadend', onLoadEnd);
|
|
1959
|
-
// Fire the request, and notify the event stream that it was fired.
|
|
1960
|
-
xhr.send(reqBody);
|
|
1961
|
-
observer.next({ type: HttpEventType.Sent });
|
|
1962
|
-
// This is the return from the Observable function, which is the
|
|
1963
|
-
// request cancellation handler.
|
|
1964
|
-
return () => {
|
|
1965
|
-
// On a cancellation, remove all registered event listeners.
|
|
1966
|
-
xhr.removeEventListener('loadstart', onLoadStart);
|
|
1967
|
-
xhr.removeEventListener('loadend', onLoadEnd);
|
|
1968
|
-
xhr.removeEventListener('error', onError);
|
|
1969
|
-
xhr.removeEventListener('abort', onError);
|
|
1970
|
-
xhr.removeEventListener('load', onLoad);
|
|
1971
|
-
xhr.removeEventListener('timeout', onError);
|
|
1972
|
-
// Cancel the background macrotask.
|
|
1973
|
-
macroTaskCanceller?.();
|
|
1927
|
+
// The upload progress event handler, which is only registered if
|
|
1928
|
+
// progress events are enabled.
|
|
1929
|
+
const onUpProgress = (event) => {
|
|
1930
|
+
// Upload progress events are simpler. Begin building the progress
|
|
1931
|
+
// event.
|
|
1932
|
+
let progress = {
|
|
1933
|
+
type: HttpEventType.UploadProgress,
|
|
1934
|
+
loaded: event.loaded,
|
|
1935
|
+
};
|
|
1936
|
+
// If the total number of bytes being uploaded is available, include
|
|
1937
|
+
// it.
|
|
1938
|
+
if (event.lengthComputable) {
|
|
1939
|
+
progress.total = event.total;
|
|
1940
|
+
}
|
|
1941
|
+
// Send the event.
|
|
1942
|
+
observer.next(progress);
|
|
1943
|
+
};
|
|
1944
|
+
// By default, register for load and error events.
|
|
1945
|
+
xhr.addEventListener('load', onLoad);
|
|
1946
|
+
xhr.addEventListener('error', onError);
|
|
1947
|
+
xhr.addEventListener('timeout', onError);
|
|
1948
|
+
xhr.addEventListener('abort', onError);
|
|
1949
|
+
// Progress events are only enabled if requested.
|
|
1974
1950
|
if (req.reportProgress) {
|
|
1975
|
-
|
|
1951
|
+
// Download progress is always enabled if requested.
|
|
1952
|
+
xhr.addEventListener('progress', onDownProgress);
|
|
1953
|
+
// Upload progress depends on whether there is a body to upload.
|
|
1976
1954
|
if (reqBody !== null && xhr.upload) {
|
|
1977
|
-
xhr.upload.
|
|
1955
|
+
xhr.upload.addEventListener('progress', onUpProgress);
|
|
1978
1956
|
}
|
|
1979
1957
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1958
|
+
let macroTaskCanceller;
|
|
1959
|
+
/** Tear down logic to cancel the backround macrotask. */
|
|
1960
|
+
const onLoadStart = () => {
|
|
1961
|
+
macroTaskCanceller ??= createBackgroundMacroTask();
|
|
1962
|
+
};
|
|
1963
|
+
const onLoadEnd = () => {
|
|
1964
|
+
macroTaskCanceller?.();
|
|
1965
|
+
};
|
|
1966
|
+
xhr.addEventListener('loadstart', onLoadStart);
|
|
1967
|
+
xhr.addEventListener('loadend', onLoadEnd);
|
|
1968
|
+
// Fire the request, and notify the event stream that it was fired.
|
|
1969
|
+
xhr.send(reqBody);
|
|
1970
|
+
observer.next({ type: HttpEventType.Sent });
|
|
1971
|
+
// This is the return from the Observable function, which is the
|
|
1972
|
+
// request cancellation handler.
|
|
1973
|
+
return () => {
|
|
1974
|
+
// On a cancellation, remove all registered event listeners.
|
|
1975
|
+
xhr.removeEventListener('loadstart', onLoadStart);
|
|
1976
|
+
xhr.removeEventListener('loadend', onLoadEnd);
|
|
1977
|
+
xhr.removeEventListener('error', onError);
|
|
1978
|
+
xhr.removeEventListener('abort', onError);
|
|
1979
|
+
xhr.removeEventListener('load', onLoad);
|
|
1980
|
+
xhr.removeEventListener('timeout', onError);
|
|
1981
|
+
// Cancel the background macrotask.
|
|
1982
|
+
macroTaskCanceller?.();
|
|
1983
|
+
if (req.reportProgress) {
|
|
1984
|
+
xhr.removeEventListener('progress', onDownProgress);
|
|
1985
|
+
if (reqBody !== null && xhr.upload) {
|
|
1986
|
+
xhr.upload.removeEventListener('progress', onUpProgress);
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
// Finally, abort the in-flight request.
|
|
1990
|
+
if (xhr.readyState !== xhr.DONE) {
|
|
1991
|
+
xhr.abort();
|
|
1992
|
+
}
|
|
1993
|
+
};
|
|
1994
|
+
});
|
|
1995
|
+
}));
|
|
1986
1996
|
}
|
|
1987
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
1988
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
1997
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1998
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXhrBackend }); }
|
|
1989
1999
|
}
|
|
1990
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
1991
2001
|
type: Injectable
|
|
1992
2002
|
}], ctorParameters: function () { return [{ type: i1.XhrFactory }]; } });
|
|
1993
2003
|
// Cannot use `Number.MAX_VALUE` as it does not fit into a 32-bit signed integer.
|
|
@@ -2051,10 +2061,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2051
2061
|
}
|
|
2052
2062
|
return this.lastToken;
|
|
2053
2063
|
}
|
|
2054
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
2055
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
2064
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2065
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfCookieExtractor }); }
|
|
2056
2066
|
}
|
|
2057
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2058
2068
|
type: Injectable
|
|
2059
2069
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2060
2070
|
type: Inject,
|
|
@@ -2094,10 +2104,10 @@ class HttpXsrfInterceptor {
|
|
|
2094
2104
|
intercept(initialRequest, next) {
|
|
2095
2105
|
return this.injector.runInContext(() => xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
2096
2106
|
}
|
|
2097
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
2098
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.
|
|
2107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2108
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfInterceptor }); }
|
|
2099
2109
|
}
|
|
2100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2101
2111
|
type: Injectable
|
|
2102
2112
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
2103
2113
|
|
|
@@ -2129,12 +2139,12 @@ function makeHttpFeature(kind, providers) {
|
|
|
2129
2139
|
* feature functions to `provideHttpClient`. For example, HTTP interceptors can be added using the
|
|
2130
2140
|
* `withInterceptors(...)` feature.
|
|
2131
2141
|
*
|
|
2132
|
-
* @see withInterceptors
|
|
2133
|
-
* @see withInterceptorsFromDi
|
|
2134
|
-
* @see withXsrfConfiguration
|
|
2135
|
-
* @see withNoXsrfProtection
|
|
2136
|
-
* @see withJsonpSupport
|
|
2137
|
-
* @see withRequestsMadeViaParent
|
|
2142
|
+
* @see {@link withInterceptors}
|
|
2143
|
+
* @see {@link withInterceptorsFromDi}
|
|
2144
|
+
* @see {@link withXsrfConfiguration}
|
|
2145
|
+
* @see {@link withNoXsrfProtection}
|
|
2146
|
+
* @see {@link withJsonpSupport}
|
|
2147
|
+
* @see {@link withRequestsMadeViaParent}
|
|
2138
2148
|
*/
|
|
2139
2149
|
function provideHttpClient(...features) {
|
|
2140
2150
|
if (ngDevMode) {
|
|
@@ -2169,8 +2179,8 @@ function provideHttpClient(...features) {
|
|
|
2169
2179
|
* Adds one or more functional-style HTTP interceptors to the configuration of the `HttpClient`
|
|
2170
2180
|
* instance.
|
|
2171
2181
|
*
|
|
2172
|
-
* @see HttpInterceptorFn
|
|
2173
|
-
* @see provideHttpClient
|
|
2182
|
+
* @see {@link HttpInterceptorFn}
|
|
2183
|
+
* @see {@link provideHttpClient}
|
|
2174
2184
|
* @publicApi
|
|
2175
2185
|
*/
|
|
2176
2186
|
function withInterceptors(interceptorFns) {
|
|
@@ -2190,9 +2200,9 @@ const LEGACY_INTERCEPTOR_FN = new InjectionToken('LEGACY_INTERCEPTOR_FN');
|
|
|
2190
2200
|
* Prefer `withInterceptors` and functional interceptors instead, as support for DI-provided
|
|
2191
2201
|
* interceptors may be phased out in a later release.
|
|
2192
2202
|
*
|
|
2193
|
-
* @see HttpInterceptor
|
|
2194
|
-
* @see HTTP_INTERCEPTORS
|
|
2195
|
-
* @see provideHttpClient
|
|
2203
|
+
* @see {@link HttpInterceptor}
|
|
2204
|
+
* @see {@link HTTP_INTERCEPTORS}
|
|
2205
|
+
* @see {@link provideHttpClient}
|
|
2196
2206
|
*/
|
|
2197
2207
|
function withInterceptorsFromDi() {
|
|
2198
2208
|
// Note: the legacy interceptor function is provided here via an intermediate token
|
|
@@ -2217,7 +2227,7 @@ function withInterceptorsFromDi() {
|
|
|
2217
2227
|
*
|
|
2218
2228
|
* This feature is incompatible with the `withNoXsrfProtection` feature.
|
|
2219
2229
|
*
|
|
2220
|
-
* @see provideHttpClient
|
|
2230
|
+
* @see {@link provideHttpClient}
|
|
2221
2231
|
*/
|
|
2222
2232
|
function withXsrfConfiguration({ cookieName, headerName }) {
|
|
2223
2233
|
const providers = [];
|
|
@@ -2234,7 +2244,7 @@ function withXsrfConfiguration({ cookieName, headerName }) {
|
|
|
2234
2244
|
*
|
|
2235
2245
|
* This feature is incompatible with the `withXsrfConfiguration` feature.
|
|
2236
2246
|
*
|
|
2237
|
-
* @see provideHttpClient
|
|
2247
|
+
* @see {@link provideHttpClient}
|
|
2238
2248
|
*/
|
|
2239
2249
|
function withNoXsrfProtection() {
|
|
2240
2250
|
return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [
|
|
@@ -2247,7 +2257,7 @@ function withNoXsrfProtection() {
|
|
|
2247
2257
|
/**
|
|
2248
2258
|
* Add JSONP support to the configuration of the current `HttpClient` instance.
|
|
2249
2259
|
*
|
|
2250
|
-
* @see provideHttpClient
|
|
2260
|
+
* @see {@link provideHttpClient}
|
|
2251
2261
|
*/
|
|
2252
2262
|
function withJsonpSupport() {
|
|
2253
2263
|
return makeHttpFeature(HttpFeatureKind.JsonpSupport, [
|
|
@@ -2273,7 +2283,7 @@ function withJsonpSupport() {
|
|
|
2273
2283
|
* "bubble up" until either reaching the root level or an `HttpClient` which was not configured with
|
|
2274
2284
|
* this option.
|
|
2275
2285
|
*
|
|
2276
|
-
* @see provideHttpClient
|
|
2286
|
+
* @see {@link provideHttpClient}
|
|
2277
2287
|
* @developerPreview
|
|
2278
2288
|
*/
|
|
2279
2289
|
function withRequestsMadeViaParent() {
|
|
@@ -2329,9 +2339,9 @@ class HttpClientXsrfModule {
|
|
|
2329
2339
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
2330
2340
|
};
|
|
2331
2341
|
}
|
|
2332
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
2333
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.
|
|
2334
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.
|
|
2342
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2343
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: HttpClientXsrfModule }); }
|
|
2344
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2335
2345
|
HttpXsrfInterceptor,
|
|
2336
2346
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2337
2347
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2342,7 +2352,7 @@ class HttpClientXsrfModule {
|
|
|
2342
2352
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2343
2353
|
] }); }
|
|
2344
2354
|
}
|
|
2345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2346
2356
|
type: NgModule,
|
|
2347
2357
|
args: [{
|
|
2348
2358
|
providers: [
|
|
@@ -2367,13 +2377,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-rc.4", ng
|
|
|
2367
2377
|
* @publicApi
|
|
2368
2378
|
*/
|
|
2369
2379
|
class HttpClientModule {
|
|
2370
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
2371
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.
|
|
2372
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.
|
|
2380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2381
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: HttpClientModule }); }
|
|
2382
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientModule, providers: [
|
|
2373
2383
|
provideHttpClient(withInterceptorsFromDi()),
|
|
2374
2384
|
] }); }
|
|
2375
2385
|
}
|
|
2376
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2377
2387
|
type: NgModule,
|
|
2378
2388
|
args: [{
|
|
2379
2389
|
/**
|
|
@@ -2394,13 +2404,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-rc.4", ng
|
|
|
2394
2404
|
* @publicApi
|
|
2395
2405
|
*/
|
|
2396
2406
|
class HttpClientJsonpModule {
|
|
2397
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.
|
|
2398
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.
|
|
2399
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.
|
|
2407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2408
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: HttpClientJsonpModule }); }
|
|
2409
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientJsonpModule, providers: [
|
|
2400
2410
|
withJsonpSupport().ɵproviders,
|
|
2401
2411
|
] }); }
|
|
2402
2412
|
}
|
|
2403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.
|
|
2413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2404
2414
|
type: NgModule,
|
|
2405
2415
|
args: [{
|
|
2406
2416
|
providers: [
|