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

Add support for custom request headers #34

Closed

Conversation

abepetrillo
Copy link

As mentioned in issue #33, I was having trouble talking to APIs who required some headers to be present such as Accept: application/json along with Content-Type.

In order to support this, I've added a configuration file for whitelisting headers we can pass on. To make my life easier I have added lodash. If the extra dependency isn't an issue we can refactor a few areas using some lodash sugar.

@abepetrillo
Copy link
Author

@technoboy10 /bump ?

@hyperobject
Copy link
Owner

I'm not too keen on the idea of adding a dependency like lodash, when the same result could be accomplished in vanilla JS by doing allowedRequestHeaders.map(toLower) instead.

@abepetrillo
Copy link
Author

Ok no problem, will update.

@abepetrillo
Copy link
Author

@technoboy10 updated.

@abepetrillo
Copy link
Author

Spotted I had forgotten to move the require. @technoboy10 launched this on heroku and is working fine.

@hyperobject
Copy link
Owner

I'll look over this within the next week.

@abepetrillo
Copy link
Author

/bump ?

@hyperobject
Copy link
Owner

Sorry for the huge delay! I'll put this on the planning board for v2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants