Skip to content

Commit

Permalink
fix: don't create Headers object if headers are already of that type
Browse files Browse the repository at this point in the history
  • Loading branch information
serozhenka committed Oct 3, 2024
1 parent 5074660 commit 14aa176
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ def _set_curl_options(
c.setopt(CurlOpt.CUSTOMREQUEST, method)

# headers
h = Headers(self.headers)
h = (
Headers(self.headers)
if not isinstance(self.headers, Headers)
else self.headers
)
h.update(headers)

# remove Host header if it's unnecessary, otherwise curl may get confused.
Expand Down

0 comments on commit 14aa176

Please sign in to comment.