go-resty / resty

Simple HTTP and REST client library for Go
MIT License
9.89k stars 696 forks source link

Set ContentLength to 0 when Body is nil #698

Closed praem90 closed 11 months ago

praem90 commented 11 months ago

To address the issue https://github.com/go-resty/resty/issues/671 set ContentLength header to 0 when Body is nil and setContentLength was set to true.

Closes #671

codecov[bot] commented 11 months ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1969424) 95.64% compared to head (ec85026) 95.65%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #698 +/- ## ======================================= Coverage 95.64% 95.65% ======================================= Files 12 12 Lines 1608 1611 +3 ======================================= + Hits 1538 1541 +3 Misses 42 42 Partials 28 28 ``` | [Files Changed](https://app.codecov.io/gh/go-resty/resty/pull/698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-resty) | Coverage Δ | | |---|---|---| | [middleware.go](https://app.codecov.io/gh/go-resty/resty/pull/698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-resty#diff-bWlkZGxld2FyZS5nbw==) | `92.22% <100.00%> (+0.07%)` | :arrow_up: |

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