From 65c9b5b6aa01784c773702dd198f1666ed4dd43b Mon Sep 17 00:00:00 2001 From: Dzmitry Shylovich Date: Mon, 12 Dec 2016 22:16:34 +0300 Subject: [PATCH] fix(http): create a copy of headers when merge options (#13365) Closes #11980 --- modules/@angular/http/src/base_request_options.ts | 2 +- modules/@angular/http/test/base_request_options_spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/@angular/http/src/base_request_options.ts b/modules/@angular/http/src/base_request_options.ts index 5409a44d91..fbc7185256 100644 --- a/modules/@angular/http/src/base_request_options.ts +++ b/modules/@angular/http/src/base_request_options.ts @@ -113,7 +113,7 @@ export class RequestOptions { merge(options?: RequestOptionsArgs): RequestOptions { return new RequestOptions({ method: options && options.method != null ? options.method : this.method, - headers: options && options.headers != null ? options.headers : this.headers, + headers: options && options.headers != null ? options.headers : new Headers(this.headers), body: options && options.body != null ? options.body : this.body, url: options && options.url != null ? options.url : this.url, search: options && options.search != null ? diff --git a/modules/@angular/http/test/base_request_options_spec.ts b/modules/@angular/http/test/base_request_options_spec.ts index ca4d4e1224..920b2a6ddc 100644 --- a/modules/@angular/http/test/base_request_options_spec.ts +++ b/modules/@angular/http/test/base_request_options_spec.ts @@ -9,6 +9,7 @@ import {describe, expect, it} from '@angular/core/testing/testing_internal'; import {BaseRequestOptions, RequestOptions} from '../src/base_request_options'; import {RequestMethod} from '../src/enums'; +import {Headers} from '../src/headers'; export function main() { describe('BaseRequestOptions', () => {