fix(http): create a copy of headers when merge options (#13365)

Closes #11980
This commit is contained in:
Dzmitry Shylovich
2016-12-12 22:16:34 +03:00
committed by Victor Berchet
parent 56dce0e26d
commit 2e500cc85b
2 changed files with 8 additions and 1 deletions

View File

@ -121,7 +121,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,
params: options && this._mergeSearchParams(options.params || options.search),