Closed ryban closed 3 years ago
If a header value is something other than a string, bytes, or list, treq will silently drop the header. It should raise an error instead.
For example this request would not send Some-Header:
Some-Header
treq.get('http://example.com', headers={'Some-Header': uuid.uuid4()})
This if statement needs a final else to raise an error.
else
https://github.com/twisted/treq/blob/7a8f45af471d172254176e4d71c8d2c0cbc5a7ae/src/treq/client.py#L171-L175
This will no longer be silent in the next release, as treq will issue a deprecation warning. The release after that, #302 calls for a TypeError.
TypeError
If a header value is something other than a string, bytes, or list, treq will silently drop the header. It should raise an error instead.
For example this request would not send
Some-Header
:This if statement needs a final
else
to raise an error.https://github.com/twisted/treq/blob/7a8f45af471d172254176e4d71c8d2c0cbc5a7ae/src/treq/client.py#L171-L175