@angular/common 21.0.0-next.0 → 21.0.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2022/http.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -690,12 +690,6 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
690
690
  * (or content types) the client is willing to receive from the server.
691
691
  */
692
692
  const ACCEPT_HEADER = 'Accept';
693
- /**
694
- * `X-Request-URL` is a custom HTTP header used in older browser versions,
695
- * including Firefox (< 32), Chrome (< 37), Safari (< 8), and Internet Explorer,
696
- * to include the full URL of the request in cross-origin requests.
697
- */
698
- const X_REQUEST_URL_HEADER = 'X-Request-URL';
699
693
  /**
700
694
  * `text/plain` is a content type used to indicate that the content being
701
695
  * sent is plain text with no special formatting or structured data
@@ -1335,18 +1329,6 @@ var HttpStatusCode;
1335
1329
  })(HttpStatusCode || (HttpStatusCode = {}));
1336
1330
 
1337
1331
  const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
1338
- /**
1339
- * Determine an appropriate URL for the response, by checking either
1340
- * response url or the X-Request-URL header.
1341
- */
1342
- function getResponseUrl$1(response) {
1343
- if (response.url) {
1344
- return response.url;
1345
- }
1346
- // stored as lowercase in the map
1347
- const xRequestUrl = X_REQUEST_URL_HEADER.toLocaleLowerCase();
1348
- return response.headers.get(xRequestUrl);
1349
- }
1350
1332
  /**
1351
1333
  * An internal injection token to reference `FetchBackend` implementation
1352
1334
  * in a tree-shakable way.
@@ -1426,7 +1408,7 @@ class FetchBackend {
1426
1408
  }
1427
1409
  const headers = new HttpHeaders(response.headers);
1428
1410
  const statusText = response.statusText;
1429
- const url = getResponseUrl$1(response) ?? request.urlWithParams;
1411
+ const url = response.url || request.urlWithParams;
1430
1412
  let status = response.status;
1431
1413
  let body = null;
1432
1414
  if (request.reportProgress) {
@@ -1505,7 +1487,7 @@ class FetchBackend {
1505
1487
  headers: new HttpHeaders(response.headers),
1506
1488
  status: response.status,
1507
1489
  statusText: response.statusText,
1508
- url: getResponseUrl$1(response) ?? request.urlWithParams,
1490
+ url: response.url || request.urlWithParams,
1509
1491
  }));
1510
1492
  return;
1511
1493
  }
@@ -1651,20 +1633,6 @@ function silenceSuperfluousUnhandledPromiseRejection(promise) {
1651
1633
  }
1652
1634
 
1653
1635
  const XSSI_PREFIX = /^\)\]\}',?\n/;
1654
- const X_REQUEST_URL_REGEXP = RegExp(`^${X_REQUEST_URL_HEADER}:`, 'm');
1655
- /**
1656
- * Determine an appropriate URL for the response, by checking either
1657
- * XMLHttpRequest.responseURL or the X-Request-URL header.
1658
- */
1659
- function getResponseUrl(xhr) {
1660
- if ('responseURL' in xhr && xhr.responseURL) {
1661
- return xhr.responseURL;
1662
- }
1663
- if (X_REQUEST_URL_REGEXP.test(xhr.getAllResponseHeaders())) {
1664
- return xhr.getResponseHeader(X_REQUEST_URL_HEADER);
1665
- }
1666
- return null;
1667
- }
1668
1636
  /**
1669
1637
  * Validates whether the request is compatible with the XHR backend.
1670
1638
  * Show a warning if the request contains options that are not supported by XHR.
@@ -1807,7 +1775,7 @@ class HttpXhrBackend {
1807
1775
  const headers = new HttpHeaders(xhr.getAllResponseHeaders());
1808
1776
  // Read the response URL from the XMLHttpResponse instance and fall back on the
1809
1777
  // request URL.
1810
- const url = getResponseUrl(xhr) || req.url;
1778
+ const url = xhr.responseURL || req.url;
1811
1779
  // Construct the HttpHeaderResponse and memoize it.
1812
1780
  headerResponse = new HttpHeaderResponse({ headers, status: xhr.status, statusText, url });
1813
1781
  return headerResponse;