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

add support for custom headers for HTTP #149

Merged
merged 1 commit into from
Nov 18, 2020
Merged

Conversation

ermeaney
Copy link

Our thrift implementation needs to have some custom headers in the HTTP call, and since the implementation was almost there I updated the make_client function to support it

@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #149 (1d951c5) into master (faf1055) will increase coverage by 0.07%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   84.05%   84.13%   +0.07%     
==========================================
  Files          44       44              
  Lines        4133     4141       +8     
==========================================
+ Hits         3474     3484      +10     
+ Misses        659      657       -2     
Impacted Files Coverage Δ
thriftpy2/http.py 88.64% <93.75%> (+1.64%) ⬆️

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 faf1055...1d951c5. Read the comment docs.

@ethe
Copy link
Member

ethe commented Nov 13, 2020

Hi, please add a test case to this feature, thanks.

thriftpy2/http.py Outdated Show resolved Hide resolved
thriftpy2/http.py Outdated Show resolved Hide resolved
thriftpy2/http.py Show resolved Hide resolved
thriftpy2/http.py Outdated Show resolved Hide resolved
tests/test_http.py Outdated Show resolved Hide resolved
tests/test_http.py Outdated Show resolved Hide resolved
thriftpy2/http.py Outdated Show resolved Hide resolved
thriftpy2/http.py Outdated Show resolved Hide resolved
@aisk
Copy link
Member

aisk commented Nov 17, 2020

LGTM, approved, thanks for the contribution @ermeaney !

But I saw there was a conflict, I think you should rebase the commits so we can merge it.

Add THttpHeaderFactory to allow client to send custom headers

fix flake8 errors

THttpClient constructor defaults THttpHeaderFactory to None
THttpHeaderFactory get_headersreturns empty dict() instead of None

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

Successfully merging this pull request may close these issues.

3 participants