Skip to content

Allow custom header fields to be set as an object.#190

Merged
alexindigo merged 1 commit intoform-data:masterfrom
DylanPiercey:master
Aug 26, 2016
Merged

Allow custom header fields to be set as an object.#190
alexindigo merged 1 commit intoform-data:masterfrom
DylanPiercey:master

Conversation

@DylanPiercey
Copy link
Copy Markdown
Member

No description provided.

@review-ninja
Copy link
Copy Markdown

ReviewNinja

@DylanPiercey
Copy link
Copy Markdown
Member Author

@alexindigo I accidentally messed up this PR. It includes #163. I will fix the PR later today unless you are fine with having both in here.

Comment thread lib/form_data.js Outdated
// it becomes responsible for boundary
// (e.g. to handle extra CRLFs on .NET servers)
if (options.header) {
if (typeof options.header === 'string') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you mind to follow style we have in the code base,
I mean non-strict equals where it's not necessary. :)

@alexindigo
Copy link
Copy Markdown
Member

It looks a bit confusing to have it together, but in the same time, looks like it's two separate chunks of code, so we should be able to treat them separately.

@alexindigo
Copy link
Copy Markdown
Member

And thanks for doing it.

@DylanPiercey
Copy link
Copy Markdown
Member Author

@alexindigo I made some fixes, let me know if there is anything else you want me to change.

And no problem for the PR, glad to finally get it out there!

Comment thread lib/form_data.js
}

var header;
for (var prop in headers) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was referenced Aug 23, 2016
Closed
@alexindigo alexindigo merged commit dd46552 into form-data:master Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants