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

fix: remove checking headers if raw content is returned from rest api #123

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

tomplus
Copy link
Owner

@tomplus tomplus commented Oct 22, 2020

It solves #122

The workaround is implemented manually on generated code. PR for OpenApi generator is on the way.

@@ -188,17 +188,15 @@ async def __call_api(
e.body = e.body.decode('utf-8') if six.PY3 else e.body
raise e

content_type = response_data.getheader('content-type')
Copy link
Owner Author

Choose a reason for hiding this comment

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

response_data can be a raw response (aiohttp ClientResponse) if _preload_content is false. The raw response doesn't have methods like getheader, getheaders. This assign is not necessary here and can be done later when preloaded content is processing.

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #123 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #123   +/-   ##
=======================================
  Coverage   31.15%   31.15%           
=======================================
  Files         817      817           
  Lines       93176    93176           
=======================================
  Hits        29031    29031           
  Misses      64145    64145           
Impacted Files Coverage Δ
kubernetes_asyncio/client/api_client.py 55.94% <100.00%> (ø)

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 6502fde...7602720. Read the comment docs.

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.

1 participant