@angular/common 18.0.0-next.1 → 18.0.0-next.3
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/fetch.mjs +3 -3
- package/esm2022/http/src/interceptor.mjs +3 -3
- package/esm2022/http/src/jsonp.mjs +6 -6
- package/esm2022/http/src/module.mjs +17 -17
- package/esm2022/http/src/request.mjs +10 -6
- package/esm2022/http/src/transfer_cache.mjs +17 -12
- package/esm2022/http/src/xhr.mjs +3 -3
- 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/image_loaders/cloudflare_loader.mjs +6 -1
- package/esm2022/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.mjs +5 -2
- package/esm2022/src/directives/ng_optimized_image/image_loaders/constants.mjs +12 -0
- package/esm2022/src/directives/ng_optimized_image/image_loaders/imagekit_loader.mjs +8 -2
- package/esm2022/src/directives/ng_optimized_image/image_loaders/imgix_loader.mjs +6 -1
- package/esm2022/src/directives/ng_optimized_image/image_loaders/netlify_loader.mjs +8 -1
- package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +4 -4
- 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 +8 -8
- package/esm2022/src/location/platform_location.mjs +6 -6
- package/esm2022/src/navigation/platform_navigation.mjs +3 -3
- 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 +6 -6
- package/esm2022/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2022/common.mjs +147 -120
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +8 -8
- package/fesm2022/http.mjs +66 -57
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +16 -16
- package/fesm2022/upgrade.mjs +5 -5
- package/http/index.d.ts +10 -4
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +3 -4
- 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 v18.0.0-next.
|
|
2
|
+
* @license Angular v18.0.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -311,10 +311,10 @@ class HttpClientTestingBackend {
|
|
|
311
311
|
return `Match by function: ${matcher.name}`;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
315
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
315
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingBackend }); }
|
|
316
316
|
}
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
|
|
318
318
|
type: Injectable
|
|
319
319
|
}] });
|
|
320
320
|
function describeRequest(testRequest) {
|
|
@@ -339,11 +339,11 @@ function provideHttpClientTesting() {
|
|
|
339
339
|
* @publicApi
|
|
340
340
|
*/
|
|
341
341
|
class HttpClientTestingModule {
|
|
342
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
343
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
344
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
342
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
343
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] }); }
|
|
344
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] }); }
|
|
345
345
|
}
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientTestingModule, decorators: [{
|
|
347
347
|
type: NgModule,
|
|
348
348
|
args: [{
|
|
349
349
|
imports: [HttpClientModule],
|
package/fesm2022/http.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-next.
|
|
2
|
+
* @license Angular v18.0.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -815,11 +815,11 @@ class HttpRequest {
|
|
|
815
815
|
}
|
|
816
816
|
// Check whether the body is already in a serialized form. If so,
|
|
817
817
|
// it can just be returned directly.
|
|
818
|
-
if (
|
|
818
|
+
if (typeof this.body === 'string' ||
|
|
819
|
+
isArrayBuffer(this.body) ||
|
|
819
820
|
isBlob(this.body) ||
|
|
820
821
|
isFormData(this.body) ||
|
|
821
|
-
isUrlSearchParams(this.body)
|
|
822
|
-
typeof this.body === 'string') {
|
|
822
|
+
isUrlSearchParams(this.body)) {
|
|
823
823
|
return this.body;
|
|
824
824
|
}
|
|
825
825
|
// Check whether the body is an instance of HttpUrlEncodedParams.
|
|
@@ -883,6 +883,9 @@ class HttpRequest {
|
|
|
883
883
|
const method = update.method || this.method;
|
|
884
884
|
const url = update.url || this.url;
|
|
885
885
|
const responseType = update.responseType || this.responseType;
|
|
886
|
+
// Carefully handle the transferCache to differentiate between
|
|
887
|
+
// `false` and `undefined` in the update args.
|
|
888
|
+
const transferCache = update.transferCache ?? this.transferCache;
|
|
886
889
|
// The body is somewhat special - a `null` value in update.body means
|
|
887
890
|
// whatever current body is present is being overridden with an empty
|
|
888
891
|
// body, whereas an `undefined` value in update.body implies no
|
|
@@ -890,8 +893,8 @@ class HttpRequest {
|
|
|
890
893
|
const body = update.body !== undefined ? update.body : this.body;
|
|
891
894
|
// Carefully handle the boolean options to differentiate between
|
|
892
895
|
// `false` and `undefined` in the update args.
|
|
893
|
-
const withCredentials = update.withCredentials
|
|
894
|
-
const reportProgress = update.reportProgress
|
|
896
|
+
const withCredentials = update.withCredentials ?? this.withCredentials;
|
|
897
|
+
const reportProgress = update.reportProgress ?? this.reportProgress;
|
|
895
898
|
// Headers and params may be appended to if `setHeaders` or
|
|
896
899
|
// `setParams` are used.
|
|
897
900
|
let headers = update.headers || this.headers;
|
|
@@ -916,6 +919,7 @@ class HttpRequest {
|
|
|
916
919
|
reportProgress,
|
|
917
920
|
responseType,
|
|
918
921
|
withCredentials,
|
|
922
|
+
transferCache,
|
|
919
923
|
});
|
|
920
924
|
}
|
|
921
925
|
}
|
|
@@ -1445,10 +1449,10 @@ class HttpClient {
|
|
|
1445
1449
|
put(url, body, options = {}) {
|
|
1446
1450
|
return this.request('PUT', url, addBody(options, body));
|
|
1447
1451
|
}
|
|
1448
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1449
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1452
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1453
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClient }); }
|
|
1450
1454
|
}
|
|
1451
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClient, decorators: [{
|
|
1452
1456
|
type: Injectable
|
|
1453
1457
|
}], ctorParameters: () => [{ type: HttpHandler }] });
|
|
1454
1458
|
|
|
@@ -1654,10 +1658,10 @@ class FetchBackend {
|
|
|
1654
1658
|
}
|
|
1655
1659
|
return chunksAll;
|
|
1656
1660
|
}
|
|
1657
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1658
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1662
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: FetchBackend }); }
|
|
1659
1663
|
}
|
|
1660
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: FetchBackend, decorators: [{
|
|
1661
1665
|
type: Injectable
|
|
1662
1666
|
}] });
|
|
1663
1667
|
/**
|
|
@@ -1786,10 +1790,10 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1786
1790
|
const taskId = this.pendingTasks.add();
|
|
1787
1791
|
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest)).pipe(finalize(() => this.pendingTasks.remove(taskId)));
|
|
1788
1792
|
}
|
|
1789
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1790
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1793
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1794
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpInterceptorHandler }); }
|
|
1791
1795
|
}
|
|
1792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1796
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1793
1797
|
type: Injectable
|
|
1794
1798
|
}], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
|
|
1795
1799
|
|
|
@@ -1989,10 +1993,10 @@ class JsonpClientBackend {
|
|
|
1989
1993
|
foreignDocument ??= this.document.implementation.createHTMLDocument();
|
|
1990
1994
|
foreignDocument.adoptNode(script);
|
|
1991
1995
|
}
|
|
1992
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1993
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1996
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1997
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpClientBackend }); }
|
|
1994
1998
|
}
|
|
1995
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
1996
2000
|
type: Injectable
|
|
1997
2001
|
}], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
1998
2002
|
type: Inject,
|
|
@@ -2030,10 +2034,10 @@ class JsonpInterceptor {
|
|
|
2030
2034
|
intercept(initialRequest, next) {
|
|
2031
2035
|
return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2032
2036
|
}
|
|
2033
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2034
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2037
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2038
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpInterceptor }); }
|
|
2035
2039
|
}
|
|
2036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
2037
2041
|
type: Injectable
|
|
2038
2042
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2039
2043
|
|
|
@@ -2313,10 +2317,10 @@ class HttpXhrBackend {
|
|
|
2313
2317
|
});
|
|
2314
2318
|
}));
|
|
2315
2319
|
}
|
|
2316
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2317
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2320
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2321
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXhrBackend }); }
|
|
2318
2322
|
}
|
|
2319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2320
2324
|
type: Injectable
|
|
2321
2325
|
}], ctorParameters: () => [{ type: i1.XhrFactory }] });
|
|
2322
2326
|
|
|
@@ -2365,10 +2369,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2365
2369
|
}
|
|
2366
2370
|
return this.lastToken;
|
|
2367
2371
|
}
|
|
2368
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2369
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2372
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2373
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfCookieExtractor }); }
|
|
2370
2374
|
}
|
|
2371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2372
2376
|
type: Injectable
|
|
2373
2377
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2374
2378
|
type: Inject,
|
|
@@ -2411,10 +2415,10 @@ class HttpXsrfInterceptor {
|
|
|
2411
2415
|
intercept(initialRequest, next) {
|
|
2412
2416
|
return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2413
2417
|
}
|
|
2414
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2415
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2419
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfInterceptor }); }
|
|
2416
2420
|
}
|
|
2417
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2418
2422
|
type: Injectable
|
|
2419
2423
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2420
2424
|
|
|
@@ -2682,9 +2686,9 @@ class HttpClientXsrfModule {
|
|
|
2682
2686
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
2683
2687
|
};
|
|
2684
2688
|
}
|
|
2685
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2686
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
2687
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2689
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2690
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientXsrfModule }); }
|
|
2691
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2688
2692
|
HttpXsrfInterceptor,
|
|
2689
2693
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2690
2694
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2695,7 +2699,7 @@ class HttpClientXsrfModule {
|
|
|
2695
2699
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2696
2700
|
] }); }
|
|
2697
2701
|
}
|
|
2698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2699
2703
|
type: NgModule,
|
|
2700
2704
|
args: [{
|
|
2701
2705
|
providers: [
|
|
@@ -2711,31 +2715,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.1",
|
|
|
2711
2715
|
}]
|
|
2712
2716
|
}] });
|
|
2713
2717
|
/**
|
|
2714
|
-
* Configures the
|
|
2718
|
+
* Configures the dependency injector for `HttpClient`
|
|
2715
2719
|
* with supporting services for XSRF. Automatically imported by `HttpClientModule`.
|
|
2716
2720
|
*
|
|
2717
2721
|
* You can add interceptors to the chain behind `HttpClient` by binding them to the
|
|
2718
|
-
* multiprovider for built-in
|
|
2722
|
+
* multiprovider for built-in DI token `HTTP_INTERCEPTORS`.
|
|
2719
2723
|
*
|
|
2720
2724
|
* @publicApi
|
|
2721
2725
|
*/
|
|
2722
2726
|
class HttpClientModule {
|
|
2723
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2724
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
2725
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2727
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2728
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientModule }); }
|
|
2729
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] }); }
|
|
2726
2730
|
}
|
|
2727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2728
2732
|
type: NgModule,
|
|
2729
2733
|
args: [{
|
|
2730
2734
|
/**
|
|
2731
|
-
* Configures the
|
|
2735
|
+
* Configures the dependency injector where it is imported
|
|
2732
2736
|
* with supporting services for HTTP communications.
|
|
2733
2737
|
*/
|
|
2734
2738
|
providers: [provideHttpClient(withInterceptorsFromDi())],
|
|
2735
2739
|
}]
|
|
2736
2740
|
}] });
|
|
2737
2741
|
/**
|
|
2738
|
-
* Configures the
|
|
2742
|
+
* Configures the dependency injector for `HttpClient`
|
|
2739
2743
|
* with supporting services for JSONP.
|
|
2740
2744
|
* Without this module, Jsonp requests reach the backend
|
|
2741
2745
|
* with method JSONP, where they are rejected.
|
|
@@ -2743,11 +2747,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.1",
|
|
|
2743
2747
|
* @publicApi
|
|
2744
2748
|
*/
|
|
2745
2749
|
class HttpClientJsonpModule {
|
|
2746
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2747
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
2748
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2750
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2751
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientJsonpModule }); }
|
|
2752
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] }); }
|
|
2749
2753
|
}
|
|
2750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2751
2755
|
type: NgModule,
|
|
2752
2756
|
args: [{
|
|
2753
2757
|
providers: [withJsonpSupport().ɵproviders],
|
|
@@ -2776,10 +2780,7 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2776
2780
|
// POST requests are allowed either globally or at request level
|
|
2777
2781
|
(requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions) ||
|
|
2778
2782
|
(requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod)) ||
|
|
2779
|
-
|
|
2780
|
-
req.headers.has('authorization') ||
|
|
2781
|
-
req.headers.has('proxy-authorization') ||
|
|
2782
|
-
requestOptions === false ||
|
|
2783
|
+
requestOptions === false || //
|
|
2783
2784
|
globalOptions.filter?.(req) === false) {
|
|
2784
2785
|
return next(req);
|
|
2785
2786
|
}
|
|
@@ -2848,16 +2849,24 @@ function getFilteredHeaders(headers, includeHeaders) {
|
|
|
2848
2849
|
}
|
|
2849
2850
|
return headersMap;
|
|
2850
2851
|
}
|
|
2851
|
-
function
|
|
2852
|
-
|
|
2853
|
-
const { params, method, responseType, url, body } = request;
|
|
2854
|
-
const encodedParams = params
|
|
2855
|
-
.keys()
|
|
2852
|
+
function sortAndConcatParams(params) {
|
|
2853
|
+
return [...params.keys()]
|
|
2856
2854
|
.sort()
|
|
2857
2855
|
.map((k) => `${k}=${params.getAll(k)}`)
|
|
2858
2856
|
.join('&');
|
|
2859
|
-
|
|
2860
|
-
|
|
2857
|
+
}
|
|
2858
|
+
function makeCacheKey(request) {
|
|
2859
|
+
// make the params encoded same as a url so it's easy to identify
|
|
2860
|
+
const { params, method, responseType, url } = request;
|
|
2861
|
+
const encodedParams = sortAndConcatParams(params);
|
|
2862
|
+
let serializedBody = request.serializeBody();
|
|
2863
|
+
if (serializedBody instanceof URLSearchParams) {
|
|
2864
|
+
serializedBody = sortAndConcatParams(serializedBody);
|
|
2865
|
+
}
|
|
2866
|
+
else if (typeof serializedBody !== 'string') {
|
|
2867
|
+
serializedBody = '';
|
|
2868
|
+
}
|
|
2869
|
+
const key = [method, responseType, url, serializedBody, encodedParams].join('|');
|
|
2861
2870
|
const hash = generateHash(key);
|
|
2862
2871
|
return makeStateKey(hash);
|
|
2863
2872
|
}
|