Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
fix: Ignore null or undefined headers
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidmt committed May 29, 2020
1 parent 319f632 commit 999c352
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
same,
toLower,
isEmpty,
is,
} from "@mutant-ws/m"

import { setProps } from "./fn.set-props"
Expand Down Expand Up @@ -60,12 +61,12 @@ const request = (
// - toLower all keys
const HEADERS = reduce(
(acc, [key, value]) =>
value === undefined
? acc
: {
is(value)
? {
...acc,
[toLower(key)]: value,
},
}
: acc,
{}
)(
Object.entries({
Expand Down

0 comments on commit 999c352

Please sign in to comment.