release-engineering / pubtools-pulplib

A Pulp library for publishing tools
GNU General Public License v3.0
2 stars 24 forks source link

Don't overwrite headers passed to Client object #209

Closed MichalHaluza closed 1 year ago

MichalHaluza commented 1 year ago

requests module populates Session object with several default headers. The behavior in pubtools-pulpib would cause the default headers dictionary to be completely overwritten by the one passed in kwargs. This is cumbersome in cases where a developer wants to set only a single header, e.g. User-Agent. The new behavior ensures the default values are retained and the new values passed in kwargs only update the existing headers dictionary.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c876a49) 100.00% compared to head (b233e50) 100.00%. Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #209 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 47 47 Lines 3153 3168 +15 ========================================= + Hits 3153 3168 +15 ``` | [Files Changed](https://app.codecov.io/gh/release-engineering/pubtools-pulplib/pull/209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering) | Coverage Δ | | |---|---|---| | [pubtools/pulplib/\_impl/client/client.py](https://app.codecov.io/gh/release-engineering/pubtools-pulplib/pull/209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering#diff-cHVidG9vbHMvcHVscGxpYi9faW1wbC9jbGllbnQvY2xpZW50LnB5) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/release-engineering/pubtools-pulplib/pull/209/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.