mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(http): include transferCache when cloning HttpRequest (#54939)
Fixes a bug where HttpRequest.clone() does not include the transferCache property. Fixes #54924. PR Close #54939
This commit is contained in:
@@ -76,6 +76,7 @@ describe('HttpRequest', () => {
|
||||
reportProgress: true,
|
||||
responseType: 'text',
|
||||
withCredentials: true,
|
||||
transferCache: true,
|
||||
});
|
||||
it('in the base case', () => {
|
||||
const clone = req.clone();
|
||||
@@ -87,6 +88,7 @@ describe('HttpRequest', () => {
|
||||
expect(clone.headers.get('Test')).toBe('Test header');
|
||||
|
||||
expect(clone.context).toBe(context);
|
||||
expect(clone.transferCache).toBe(true);
|
||||
});
|
||||
it('and updates the url', () => {
|
||||
expect(req.clone({url: '/changed'}).url).toBe('/changed');
|
||||
@@ -101,6 +103,9 @@ describe('HttpRequest', () => {
|
||||
const newContext = new HttpContext();
|
||||
expect(req.clone({context: newContext}).context).toBe(newContext);
|
||||
});
|
||||
it('and updates the transferCache', () => {
|
||||
expect(req.clone({transferCache: false}).transferCache).toBe(false);
|
||||
});
|
||||
});
|
||||
describe('content type detection', () => {
|
||||
const baseReq = new HttpRequest('POST', '/test', null);
|
||||
|
||||
Reference in New Issue
Block a user