Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Allow users to pass in headers at method call.#130

Merged
landrito merged 3 commits intogoogleapis:masterfrom
landrito:user-headers
Apr 17, 2017
Merged

Allow users to pass in headers at method call.#130
landrito merged 3 commits intogoogleapis:masterfrom
landrito:user-headers

Conversation

@landrito
Copy link
Copy Markdown
Contributor

cc @stephenplusplus

This should help users set other headers as needed here

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 14, 2017

Codecov Report

Merging #130 into master will increase coverage by 0.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #130     +/-   ##
=========================================
+ Coverage    92.3%   92.71%   +0.4%     
=========================================
  Files          11       11             
  Lines        1300     1304      +4     
  Branches      267      269      +2     
=========================================
+ Hits         1200     1209      +9     
+ Misses        100       95      -5
Impacted Files Coverage Δ
lib/api_callable.js 95.38% <100%> (+0.14%) ⬆️
lib/gax.js 94.61% <0%> (+3.84%) ⬆️

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 5723900...c2d1602. Read the comment docs.

@stephenplusplus
Copy link
Copy Markdown
Contributor

Cool, thank you!

var headers = otherArgs.headers || {};
for (var key in headers) {
if (headers.hasOwnProperty(key)) {
metadata.set(key, headers[key]);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Copy Markdown
Contributor

@jmuk jmuk left a comment

Choose a reason for hiding this comment

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

LGTM, with a suggestion of adding a test case.

expect(setSpy.secondCall.args).to.deep.equal(['h2', 'val2']);
done();
});
});

This comment was marked as spam.

This comment was marked as spam.

@landrito landrito merged commit 8afd992 into googleapis:master Apr 17, 2017
@stephenplusplus
Copy link
Copy Markdown
Contributor

Thank you! Please give me a ping when the new release it out.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants