Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

feat: add support for custom headers to send-request #741

Merged
merged 6 commits into from
Jun 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/send-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function requestAPI (config, options, callback) {
delete options.qs.followSymlinks

const method = 'POST'
const headers = {}
const headers = config.headers || {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need an Object.assign({}, config.headers) to avoid mutating the headers object passed as config, otherwise subsequent requests will receive the same headers as previous.


if (isNode) {
// Browsers do not allow you to modify the user agent
Expand Down