-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix haveibeenpwned user-agent string #84919
Conversation
Note that this integration still needs a 3rd party library for the interface code to the service, but we're going to accept this small fix. Larger changes will need a 3rd party library first. |
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
I updated the branch as suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes sense. Previously, it was mixing 2 different HTTP client libraries (aiohttp and requests). This change standardizes on "requests"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Fixed user-agent string not being accepted as an valid header * Update homeassistant/components/haveibeenpwned/sensor.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Removed the aiohttp import Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Fixed user-agent string not being accepted as an valid header * Update homeassistant/components/haveibeenpwned/sensor.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Removed the aiohttp import Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Breaking change
Proposed change
The HaveIBeenComponent was broken because the requests library does no longer allow an istr in a header, only a str.
The user-agent header is now first converted to a str which fixes the issue
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: