Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting headers #10

Merged
merged 4 commits into from
Feb 21, 2017
Merged

Conversation

adamsanderson
Copy link
Contributor

Addresses #3 by allowing users to set options.headers in connectRequest.

If present, any headers specified in the options passed to connectRequest will be applied to the request.
@ryanashcraft
Copy link
Contributor

This looks great! Thanks for adding a test and update the README. Seems npm run lint is complaining, though.

I'm currently on vacation so I will have to take another look when I get back.

@adamsanderson
Copy link
Contributor Author

adamsanderson commented Feb 17, 2017 via email

@codecov-io
Copy link

codecov-io commented Feb 18, 2017

Codecov Report

Merging #10 into master will increase coverage by 0.22%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
+ Coverage   88.34%   88.57%   +0.22%     
==========================================
  Files           7        7              
  Lines         206      210       +4     
==========================================
+ Hits          182      186       +4     
  Misses         24       24
Impacted Files Coverage Δ
src/middleware/query.js 88.8% <100%> (+0.34%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d11bf2...f6cefd7. Read the comment docs.

@ryanashcraft
Copy link
Contributor

@adamsanderson Can you modify the MUTATE_ASYNC case in the query middleware to set the headers for mutations? And it'd be great if you could add an accompanying test for mutations in query.tests.js. Thanks!

The `MUTATE_ASYNC` action type now supports custom headers by setting the `headers` key in the action's `options` hash.
@adamsanderson
Copy link
Contributor Author

Sure, no problem. For one reason or another I assumed that the both the mutations and the query branches shared the same request configuration code and didn't look closely enough. This should do the trick.

@ryanashcraft ryanashcraft merged commit 237dbd0 into amplitude:master Feb 21, 2017
@ryanashcraft
Copy link
Contributor

@adamsanderson Thanks for this change!

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

Successfully merging this pull request may close these issues.

3 participants