aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Add ClientResponse.certificate and populate it, if appropriate

Open auxsvr opened this issue 3 years ago • 3 comments

Fixes #2816.

What do these changes do?

Add ClientResponse.certificate and populate it, if appropriate.

Are there changes in behavior for the user?

Yes, the ClientResponse.certificate property contains the server certificate, if available.

Related issue number

#2816

Checklist

  • [x] I think the code is well written
  • [x] Unit tests for the changes exist
  • [x] Documentation reflects the changes
  • [x] If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • [x] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

auxsvr avatar Jan 23 '23 18:01 auxsvr

Codecov Report

Merging #7181 (d9172ae) into master (3a8e65f) will decrease coverage by 0.01%. The diff coverage is 94.73%.

:exclamation: Current head d9172ae differs from pull request most recent head 62435c0. Consider uploading reports for the commit 62435c0 to get more accurate results

@@            Coverage Diff             @@
##           master    #7181      +/-   ##
==========================================
- Coverage   97.31%   97.31%   -0.01%     
==========================================
  Files         106      106              
  Lines       31260    31278      +18     
  Branches     3891     3893       +2     
==========================================
+ Hits        30420    30437      +17     
  Misses        637      637              
- Partials      203      204       +1     
Flag Coverage Δ
CI-GHA 97.21% <94.73%> (-0.01%) :arrow_down:
OS-Linux 96.87% <94.73%> (-0.01%) :arrow_down:
OS-Windows 95.27% <94.73%> (-0.01%) :arrow_down:
OS-macOS 96.44% <94.73%> (-0.01%) :arrow_down:
Py-3.10.10 ?
Py-3.10.9 96.96% <94.73%> (-0.01%) :arrow_down:
Py-3.11.0 95.49% <26.31%> (-0.05%) :arrow_down:
Py-3.7.15 96.69% <94.73%> (-0.01%) :arrow_down:
Py-3.7.9 95.16% <94.73%> (-0.01%) :arrow_down:
Py-3.8.10 95.06% <94.73%> (-0.01%) :arrow_down:
Py-3.8.16 96.58% <94.73%> (-0.01%) :arrow_down:
Py-3.9.13 95.06% <94.73%> (-0.01%) :arrow_down:
Py-3.9.16 96.60% <94.73%> (-0.01%) :arrow_down:
Py-pypy7.3.11 94.11% <94.73%> (-0.02%) :arrow_down:
VM-macos 96.44% <94.73%> (-0.01%) :arrow_down:
VM-ubuntu 96.87% <94.73%> (-0.01%) :arrow_down:
VM-windows 95.27% <94.73%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohttp/client_reqrep.py 97.58% <75.00%> (-0.15%) :arrow_down:
tests/test_client_request.py 99.58% <100.00%> (+<0.01%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Jan 27 '23 17:01 codecov[bot]

The linter failure in mypy is spurious. Should I silence this instance or is there a better way?

auxsvr avatar Feb 28 '23 09:02 auxsvr

The linter failure in mypy is spurious. Should I silence this instance or is there a better way?

mypy is pretty much deterministic, the failure will appear every time. In this case, the variable is defined as None in the class definition: https://github.com/aio-libs/aiohttp/pull/7181/files#diff-720910fd022b9ba8b7ddf0cb446ce5e1afe443f4287ad26a1eb4dc4b5b5f4508R677

Dreamsorcerer avatar Feb 28 '23 17:02 Dreamsorcerer