Skip to content

There is currently no ability to remove a Content-Type header #6

@klardotsh

Description

@klardotsh

Defaults currently uses the following logic to extend the options object:

function defaults (target, obj) {
    for (var prop in obj) target[prop] = target[prop] || obj[prop]
}

If you would prefer to not send a Content-Type at all, you'd not want it in the headers array (I don't believe fetch sets a Content-Type by default, if it does then my logic is wrong). By passing { 'Content-Type': undefined } into the fetchival options, it will hit the || logic of the extender, keeping the default header rather than removing the header as is the expected behavior.

The fix will be to forcibly set any "own properties" of the incoming object, even if they are not truthy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions