filcole / pycarwings2

Python library for interacting with the NissanConnect EV (aka CARWINGS) telematics service.
Apache License 2.0
33 stars 20 forks source link

fixes urllib3 adding a User-Agent header #23

Closed Kalkran closed 4 years ago

Kalkran commented 4 years ago

urllib3 which is used by the requests library has started adding a default User-Agent header. The Nissan servers do not accept any requests when there is a User-Agent header present.

This request is a little ugly, but prevents the default _HTTPConnection class inside urllib3 from adding a User-Agent header.

Kalkran commented 4 years ago

Seems I was too quick. While adding "None" no longer works, an empty string still prevents the urllib3 from sending out a User-Agent header.