fix(ts-fetch): preserve available headers (#5650)

This commit is contained in:
Gavin Sitthiampornphan 2017-06-29 21:47:03 +07:00 committed by wing328
parent 6fa4853fe7
commit d210236040

View File

@ -116,11 +116,11 @@ export const {{classname}}FetchParamCreator = {
{{#hasHeaderParams}}
fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({
{{#headerParams}}"{{baseName}}": params["{{paramName}}"],{{/headerParams}}
}, contentTypeHeader);
}, contentTypeHeader, fetchOptions.headers);
{{/hasHeaderParams}}
{{^hasHeaderParams}}
if (contentTypeHeader) {
fetchOptions.headers = contentTypeHeader;
fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({}, contentTypeHeader, fetchOptions.headers);
}
{{/hasHeaderParams}}
return {