@angular/common 19.1.0-rc.0 → 19.1.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/fesm2022/common.mjs +244 -250
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +8 -8
- package/fesm2022/http.mjs +97 -60
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +16 -16
- package/fesm2022/upgrade.mjs +5 -5
- package/http/index.d.ts +2 -2
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +31 -18
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.1.
|
|
2
|
+
* @license Angular v19.1.1
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -315,10 +315,10 @@ class HttpClientTestingBackend {
|
|
|
315
315
|
return `Match by function: ${matcher.name}`;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
319
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
319
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingBackend });
|
|
320
320
|
}
|
|
321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
|
|
322
322
|
type: Injectable
|
|
323
323
|
}] });
|
|
324
324
|
function describeRequest(testRequest) {
|
|
@@ -346,11 +346,11 @@ function provideHttpClientTesting() {
|
|
|
346
346
|
* @deprecated Add `provideHttpClientTesting()` to your providers instead.
|
|
347
347
|
*/
|
|
348
348
|
class HttpClientTestingModule {
|
|
349
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
350
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.
|
|
351
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.
|
|
349
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
350
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
|
|
351
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] });
|
|
352
352
|
}
|
|
353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientTestingModule, decorators: [{
|
|
354
354
|
type: NgModule,
|
|
355
355
|
args: [{
|
|
356
356
|
imports: [HttpClientModule],
|
package/fesm2022/http.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.1.
|
|
2
|
+
* @license Angular v19.1.1
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { Injectable, inject, NgZone, runInInjectionContext,
|
|
8
|
+
import { ɵRuntimeError, Injectable, InjectionToken, inject, NgZone, runInInjectionContext, ɵPendingTasksInternal, PLATFORM_ID, ɵConsole, ɵformatRuntimeError, Inject, makeEnvironmentProviders, NgModule, TransferState, makeStateKey, ɵperformanceMarkFeature, APP_BOOTSTRAP_LISTENER, ApplicationRef, ɵtruncateMiddle } from '@angular/core';
|
|
9
9
|
import { of, Observable, from } from 'rxjs';
|
|
10
10
|
import { concatMap, filter, map, finalize, switchMap, tap } from 'rxjs/operators';
|
|
11
11
|
import * as i1 from '@angular/common';
|
|
@@ -388,9 +388,9 @@ class HttpParams {
|
|
|
388
388
|
cloneFrom = null;
|
|
389
389
|
constructor(options = {}) {
|
|
390
390
|
this.encoder = options.encoder || new HttpUrlEncodingCodec();
|
|
391
|
-
if (
|
|
392
|
-
if (
|
|
393
|
-
throw new
|
|
391
|
+
if (options.fromString) {
|
|
392
|
+
if (options.fromObject) {
|
|
393
|
+
throw new ɵRuntimeError(2805 /* RuntimeErrorCode.CANNOT_SPECIFY_BOTH_FROM_STRING_AND_FROM_OBJECT */, ngDevMode && 'Cannot specify both fromString and fromObject.');
|
|
394
394
|
}
|
|
395
395
|
this.map = paramParser(options.fromString, this.encoder);
|
|
396
396
|
}
|
|
@@ -708,6 +708,36 @@ function isFormData(value) {
|
|
|
708
708
|
function isUrlSearchParams(value) {
|
|
709
709
|
return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;
|
|
710
710
|
}
|
|
711
|
+
/**
|
|
712
|
+
* `Content-Type` is an HTTP header used to indicate the media type
|
|
713
|
+
* (also known as MIME type) of the resource being sent to the client
|
|
714
|
+
* or received from the server.
|
|
715
|
+
*/
|
|
716
|
+
const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
717
|
+
/**
|
|
718
|
+
* `X-Request-URL` is a custom HTTP header used in older browser versions,
|
|
719
|
+
* including Firefox (< 32), Chrome (< 37), Safari (< 8), and Internet Explorer,
|
|
720
|
+
* to include the full URL of the request in cross-origin requests.
|
|
721
|
+
*/
|
|
722
|
+
const X_REQUEST_URL_HEADER = 'X-Request-URL';
|
|
723
|
+
/**
|
|
724
|
+
* `text/plain` is a content type used to indicate that the content being
|
|
725
|
+
* sent is plain text with no special formatting or structured data
|
|
726
|
+
* like HTML, XML, or JSON.
|
|
727
|
+
*/
|
|
728
|
+
const TEXT_CONTENT_TYPE = 'text/plain';
|
|
729
|
+
/**
|
|
730
|
+
* `application/json` is a content type used to indicate that the content
|
|
731
|
+
* being sent is in the JSON format.
|
|
732
|
+
*/
|
|
733
|
+
const JSON_CONTENT_TYPE = 'application/json';
|
|
734
|
+
/**
|
|
735
|
+
* `application/json, text/plain, *\/*` is a content negotiation string often seen in the
|
|
736
|
+
* Accept header of HTTP requests. It indicates the types of content the client is willing
|
|
737
|
+
* to accept from the server, with a preference for `application/json` and `text/plain`,
|
|
738
|
+
* but also accepting any other type (*\/*).
|
|
739
|
+
*/
|
|
740
|
+
const ACCEPT_HEADER = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`;
|
|
711
741
|
/**
|
|
712
742
|
* An outgoing HTTP request with an optional typed body.
|
|
713
743
|
*
|
|
@@ -767,7 +797,7 @@ class HttpRequest {
|
|
|
767
797
|
* To pass a string representation of HTTP parameters in the URL-query-string format,
|
|
768
798
|
* the `HttpParamsOptions`' `fromString` may be used. For example:
|
|
769
799
|
*
|
|
770
|
-
* ```
|
|
800
|
+
* ```ts
|
|
771
801
|
* new HttpParams({fromString: 'angular=awesome'})
|
|
772
802
|
* ```
|
|
773
803
|
*/
|
|
@@ -909,7 +939,7 @@ class HttpRequest {
|
|
|
909
939
|
// Technically, strings could be a form of JSON data, but it's safe enough
|
|
910
940
|
// to assume they're plain strings.
|
|
911
941
|
if (typeof this.body === 'string') {
|
|
912
|
-
return
|
|
942
|
+
return TEXT_CONTENT_TYPE;
|
|
913
943
|
}
|
|
914
944
|
// `HttpUrlEncodedParams` has its own content-type.
|
|
915
945
|
if (this.body instanceof HttpParams) {
|
|
@@ -919,7 +949,7 @@ class HttpRequest {
|
|
|
919
949
|
if (typeof this.body === 'object' ||
|
|
920
950
|
typeof this.body === 'number' ||
|
|
921
951
|
typeof this.body === 'boolean') {
|
|
922
|
-
return
|
|
952
|
+
return JSON_CONTENT_TYPE;
|
|
923
953
|
}
|
|
924
954
|
// No type could be inferred.
|
|
925
955
|
return null;
|
|
@@ -1535,15 +1565,14 @@ class HttpClient {
|
|
|
1535
1565
|
put(url, body, options = {}) {
|
|
1536
1566
|
return this.request('PUT', url, addBody(options, body));
|
|
1537
1567
|
}
|
|
1538
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1539
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
1568
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1569
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClient });
|
|
1540
1570
|
}
|
|
1541
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClient, decorators: [{
|
|
1542
1572
|
type: Injectable
|
|
1543
1573
|
}], ctorParameters: () => [{ type: HttpHandler }] });
|
|
1544
1574
|
|
|
1545
1575
|
const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
|
|
1546
|
-
const REQUEST_URL_HEADER = `X-Request-URL`;
|
|
1547
1576
|
/**
|
|
1548
1577
|
* Determine an appropriate URL for the response, by checking either
|
|
1549
1578
|
* response url or the X-Request-URL header.
|
|
@@ -1553,9 +1582,14 @@ function getResponseUrl$1(response) {
|
|
|
1553
1582
|
return response.url;
|
|
1554
1583
|
}
|
|
1555
1584
|
// stored as lowercase in the map
|
|
1556
|
-
const xRequestUrl =
|
|
1585
|
+
const xRequestUrl = X_REQUEST_URL_HEADER.toLocaleLowerCase();
|
|
1557
1586
|
return response.headers.get(xRequestUrl);
|
|
1558
1587
|
}
|
|
1588
|
+
/**
|
|
1589
|
+
* An internal injection token to reference `FetchBackend` implementation
|
|
1590
|
+
* in a tree-shakable way.
|
|
1591
|
+
*/
|
|
1592
|
+
const FETCH_BACKEND = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'FETCH_BACKEND' : '');
|
|
1559
1593
|
/**
|
|
1560
1594
|
* Uses `fetch` to send requests to a backend server.
|
|
1561
1595
|
*
|
|
@@ -1655,7 +1689,7 @@ class FetchBackend {
|
|
|
1655
1689
|
// Combine all chunks.
|
|
1656
1690
|
const chunksAll = this.concatChunks(chunks, receivedLength);
|
|
1657
1691
|
try {
|
|
1658
|
-
const contentType = response.headers.get(
|
|
1692
|
+
const contentType = response.headers.get(CONTENT_TYPE_HEADER) ?? '';
|
|
1659
1693
|
body = this.parseBody(request, chunksAll, contentType);
|
|
1660
1694
|
}
|
|
1661
1695
|
catch (error) {
|
|
@@ -1723,14 +1757,14 @@ class FetchBackend {
|
|
|
1723
1757
|
req.headers.forEach((name, values) => (headers[name] = values.join(',')));
|
|
1724
1758
|
// Add an Accept header if one isn't present already.
|
|
1725
1759
|
if (!req.headers.has('Accept')) {
|
|
1726
|
-
headers['Accept'] =
|
|
1760
|
+
headers['Accept'] = ACCEPT_HEADER;
|
|
1727
1761
|
}
|
|
1728
1762
|
// Auto-detect the Content-Type header if one isn't present already.
|
|
1729
|
-
if (!req.headers.has(
|
|
1763
|
+
if (!req.headers.has(CONTENT_TYPE_HEADER)) {
|
|
1730
1764
|
const detectedType = req.detectContentTypeHeader();
|
|
1731
1765
|
// Sometimes Content-Type detection fails.
|
|
1732
1766
|
if (detectedType !== null) {
|
|
1733
|
-
headers[
|
|
1767
|
+
headers[CONTENT_TYPE_HEADER] = detectedType;
|
|
1734
1768
|
}
|
|
1735
1769
|
}
|
|
1736
1770
|
return {
|
|
@@ -1749,10 +1783,10 @@ class FetchBackend {
|
|
|
1749
1783
|
}
|
|
1750
1784
|
return chunksAll;
|
|
1751
1785
|
}
|
|
1752
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1753
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
1786
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1787
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: FetchBackend });
|
|
1754
1788
|
}
|
|
1755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: FetchBackend, decorators: [{
|
|
1756
1790
|
type: Injectable
|
|
1757
1791
|
}] });
|
|
1758
1792
|
/**
|
|
@@ -1893,10 +1927,10 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1893
1927
|
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
|
|
1894
1928
|
}
|
|
1895
1929
|
}
|
|
1896
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1897
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
1930
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1931
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpInterceptorHandler });
|
|
1898
1932
|
}
|
|
1899
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1900
1934
|
type: Injectable
|
|
1901
1935
|
}], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
|
|
1902
1936
|
|
|
@@ -2098,10 +2132,10 @@ class JsonpClientBackend {
|
|
|
2098
2132
|
foreignDocument ??= this.document.implementation.createHTMLDocument();
|
|
2099
2133
|
foreignDocument.adoptNode(script);
|
|
2100
2134
|
}
|
|
2101
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2102
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
2135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2136
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpClientBackend });
|
|
2103
2137
|
}
|
|
2104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
2105
2139
|
type: Injectable
|
|
2106
2140
|
}], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
2107
2141
|
type: Inject,
|
|
@@ -2140,14 +2174,15 @@ class JsonpInterceptor {
|
|
|
2140
2174
|
intercept(initialRequest, next) {
|
|
2141
2175
|
return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2142
2176
|
}
|
|
2143
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2144
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
2177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2178
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpInterceptor });
|
|
2145
2179
|
}
|
|
2146
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
2147
2181
|
type: Injectable
|
|
2148
2182
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2149
2183
|
|
|
2150
2184
|
const XSSI_PREFIX = /^\)\]\}',?\n/;
|
|
2185
|
+
const X_REQUEST_URL_REGEXP = RegExp(`^${X_REQUEST_URL_HEADER}:`, 'm');
|
|
2151
2186
|
/**
|
|
2152
2187
|
* Determine an appropriate URL for the response, by checking either
|
|
2153
2188
|
* XMLHttpRequest.responseURL or the X-Request-URL header.
|
|
@@ -2156,8 +2191,8 @@ function getResponseUrl(xhr) {
|
|
|
2156
2191
|
if ('responseURL' in xhr && xhr.responseURL) {
|
|
2157
2192
|
return xhr.responseURL;
|
|
2158
2193
|
}
|
|
2159
|
-
if (
|
|
2160
|
-
return xhr.getResponseHeader(
|
|
2194
|
+
if (X_REQUEST_URL_REGEXP.test(xhr.getAllResponseHeaders())) {
|
|
2195
|
+
return xhr.getResponseHeader(X_REQUEST_URL_HEADER);
|
|
2161
2196
|
}
|
|
2162
2197
|
return null;
|
|
2163
2198
|
}
|
|
@@ -2206,14 +2241,14 @@ class HttpXhrBackend {
|
|
|
2206
2241
|
req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(',')));
|
|
2207
2242
|
// Add an Accept header if one isn't present already.
|
|
2208
2243
|
if (!req.headers.has('Accept')) {
|
|
2209
|
-
xhr.setRequestHeader('Accept',
|
|
2244
|
+
xhr.setRequestHeader('Accept', ACCEPT_HEADER);
|
|
2210
2245
|
}
|
|
2211
2246
|
// Auto-detect the Content-Type header if one isn't present already.
|
|
2212
|
-
if (!req.headers.has(
|
|
2247
|
+
if (!req.headers.has(CONTENT_TYPE_HEADER)) {
|
|
2213
2248
|
const detectedType = req.detectContentTypeHeader();
|
|
2214
2249
|
// Sometimes Content-Type detection fails.
|
|
2215
2250
|
if (detectedType !== null) {
|
|
2216
|
-
xhr.setRequestHeader(
|
|
2251
|
+
xhr.setRequestHeader(CONTENT_TYPE_HEADER, detectedType);
|
|
2217
2252
|
}
|
|
2218
2253
|
}
|
|
2219
2254
|
// Set the responseType if one was requested.
|
|
@@ -2424,10 +2459,10 @@ class HttpXhrBackend {
|
|
|
2424
2459
|
});
|
|
2425
2460
|
}));
|
|
2426
2461
|
}
|
|
2427
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2428
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
2462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2463
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXhrBackend });
|
|
2429
2464
|
}
|
|
2430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2431
2466
|
type: Injectable
|
|
2432
2467
|
}], ctorParameters: () => [{ type: i1.XhrFactory }] });
|
|
2433
2468
|
|
|
@@ -2479,10 +2514,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2479
2514
|
}
|
|
2480
2515
|
return this.lastToken;
|
|
2481
2516
|
}
|
|
2482
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2483
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
2517
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2518
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfCookieExtractor });
|
|
2484
2519
|
}
|
|
2485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2486
2521
|
type: Injectable
|
|
2487
2522
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2488
2523
|
type: Inject,
|
|
@@ -2526,10 +2561,10 @@ class HttpXsrfInterceptor {
|
|
|
2526
2561
|
intercept(initialRequest, next) {
|
|
2527
2562
|
return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2528
2563
|
}
|
|
2529
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2530
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
2564
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2565
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfInterceptor });
|
|
2531
2566
|
}
|
|
2532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2533
2568
|
type: Injectable
|
|
2534
2569
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2535
2570
|
|
|
@@ -2601,7 +2636,7 @@ function provideHttpClient(...features) {
|
|
|
2601
2636
|
{
|
|
2602
2637
|
provide: HttpBackend,
|
|
2603
2638
|
useFactory: () => {
|
|
2604
|
-
return inject(
|
|
2639
|
+
return inject(FETCH_BACKEND, { optional: true }) ?? inject(HttpXhrBackend);
|
|
2605
2640
|
},
|
|
2606
2641
|
},
|
|
2607
2642
|
{
|
|
@@ -2752,6 +2787,7 @@ function withRequestsMadeViaParent() {
|
|
|
2752
2787
|
function withFetch() {
|
|
2753
2788
|
return makeHttpFeature(HttpFeatureKind.Fetch, [
|
|
2754
2789
|
FetchBackend,
|
|
2790
|
+
{ provide: FETCH_BACKEND, useExisting: FetchBackend },
|
|
2755
2791
|
{ provide: HttpBackend, useExisting: FetchBackend },
|
|
2756
2792
|
]);
|
|
2757
2793
|
}
|
|
@@ -2794,9 +2830,9 @@ class HttpClientXsrfModule {
|
|
|
2794
2830
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
2795
2831
|
};
|
|
2796
2832
|
}
|
|
2797
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2798
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.
|
|
2799
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.
|
|
2833
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2834
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: HttpClientXsrfModule });
|
|
2835
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2800
2836
|
HttpXsrfInterceptor,
|
|
2801
2837
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2802
2838
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2807,7 +2843,7 @@ class HttpClientXsrfModule {
|
|
|
2807
2843
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2808
2844
|
] });
|
|
2809
2845
|
}
|
|
2810
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2811
2847
|
type: NgModule,
|
|
2812
2848
|
args: [{
|
|
2813
2849
|
providers: [
|
|
@@ -2833,11 +2869,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ng
|
|
|
2833
2869
|
* @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
|
|
2834
2870
|
*/
|
|
2835
2871
|
class HttpClientModule {
|
|
2836
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2837
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.
|
|
2838
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.
|
|
2872
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2873
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: HttpClientModule });
|
|
2874
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
|
|
2839
2875
|
}
|
|
2840
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2841
2877
|
type: NgModule,
|
|
2842
2878
|
args: [{
|
|
2843
2879
|
/**
|
|
@@ -2857,11 +2893,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ng
|
|
|
2857
2893
|
* @deprecated `withJsonpSupport()` as providers instead
|
|
2858
2894
|
*/
|
|
2859
2895
|
class HttpClientJsonpModule {
|
|
2860
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
2861
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.
|
|
2862
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.
|
|
2896
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2897
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: HttpClientJsonpModule });
|
|
2898
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
|
|
2863
2899
|
}
|
|
2864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
2900
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2865
2901
|
type: NgModule,
|
|
2866
2902
|
args: [{
|
|
2867
2903
|
providers: [withJsonpSupport().ɵproviders],
|
|
@@ -2927,14 +2963,15 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2927
2963
|
const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {
|
|
2928
2964
|
optional: true,
|
|
2929
2965
|
});
|
|
2930
|
-
|
|
2931
|
-
if (originMap && !isServer) {
|
|
2966
|
+
if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {
|
|
2932
2967
|
throw new ɵRuntimeError(2803 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT */, ngDevMode &&
|
|
2933
2968
|
'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +
|
|
2934
2969
|
'present in the client side code. Please ensure that this token is only provided in the ' +
|
|
2935
2970
|
'server code of the application.');
|
|
2936
2971
|
}
|
|
2937
|
-
const requestUrl =
|
|
2972
|
+
const requestUrl = typeof ngServerMode !== 'undefined' && ngServerMode && originMap
|
|
2973
|
+
? mapRequestOriginUrl(req.url, originMap)
|
|
2974
|
+
: req.url;
|
|
2938
2975
|
const storeKey = makeCacheKey(req, requestUrl);
|
|
2939
2976
|
const response = transferState.get(storeKey, null);
|
|
2940
2977
|
let headersToInclude = globalOptions.includeHeaders;
|
|
@@ -2974,7 +3011,7 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2974
3011
|
}
|
|
2975
3012
|
// Request not found in cache. Make the request and cache it if on the server.
|
|
2976
3013
|
return next(req).pipe(tap((event) => {
|
|
2977
|
-
if (event instanceof HttpResponse &&
|
|
3014
|
+
if (event instanceof HttpResponse && typeof ngServerMode !== 'undefined' && ngServerMode) {
|
|
2978
3015
|
transferState.set(storeKey, {
|
|
2979
3016
|
[BODY]: event.body,
|
|
2980
3017
|
[HEADERS]: getFilteredHeaders(event.headers, headersToInclude),
|