twisted / treq

Python requests like API built on top of Twisted's HTTP client.
Other
587 stars 139 forks source link

treq.auth.add_basic_auth agent mutates passed Headers #314

Closed twm closed 3 years ago

twm commented 3 years ago

The agent returned by treq.auth.add_basic_auth (and therefore treq.add_auth, and therefore treq.request()) mutates any Headers instance passed to it.

This is surprising. Doubly so, given that the wrapper agent's own implementation assumes that the agent it wraps doesn't mutate the headers.