You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can lead to unexpected behavior, in particular in the case of the headers (and probably others, like cookies) attribute. requests defaults to a case insensitive dict, but providing headers in request_kwargs as a simple dict would override this default dict implementation used.
Instead, we should probably call the update method if these attributes have a dict-like interface.
The text was updated successfully, but these errors were encountered:
Can't we instead document that if you provide the arguments, you need to match the types from requests? And specifically provide the example from the headers that it should be set to a case insensitive dict?
An alternative would be a lookup table from name -> approprivate type to wrap it with, depending on how complex that conversion is. We could silently set up a CaseInsensitiveDict 🤔
This specific bit of code:
ape-pie/src/ape_pie/client.py
Lines 82 to 86 in 979972d
can lead to unexpected behavior, in particular in the case of the
headers
(and probably others, likecookies
) attribute.requests
defaults to a case insensitive dict, but providing headers inrequest_kwargs
as a simple dict would override this default dict implementation used.Instead, we should probably call the
update
method if these attributes have a dict-like interface.The text was updated successfully, but these errors were encountered: