-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[surepetcare] Adapt blocked user agent #15047
Conversation
Fixes openhab#15046 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
...surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareAPIHelper.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
0a3ba46
to
9da8b0c
Compare
@openhab/add-ons-maintainers - please consider this for being cherry-picked into 3.4.x since the previous hardcoded user-agent has recently been blocked, so the binding doesn't work anymore. |
Thanks very much for the PR! |
You're very welcome, it was an easy fix, let's see if it will last. 🙂 |
Is Jetty blocked by SurePetCare or why do we change the user agent at all? |
See the linked issue or forum post. The previous hardcoded user-agent is blocked. |
Yes, but that is already user agent that is not the default. The default is something like |
Why do you think it's better to expose "Jetty" rather than "openHAB"? |
A privacy concern. ;) |
It's not "better". I'm just wondering if it is necessary. |
It's an interesting problem, and I'm not sure what is best. In an ideal world I think it would be best to provide the user-agent as accurate (honest, if you will) as possible. Service providers can then use this for analysis of incoming traffic, or even to block very old (or misbehaving) clients like in this case. The actual HTTP client in this case is Jetty, but I think it's more relevant to know that the traffic is from the openHAB integration. It might even be best to include both, e.g. "openHAB/4.0.0 Jetty/9.2.4.v20141103)". I don't remember if this is done by Jetty already, or only in case of 3xx redirects, but I'll check. |
@J-N-K - okay for you to cherry-pick to 3.4.x? |
Logged as "Jetty/9.4.50.v20221201, openHAB/4.0.0". |
* Adapt blocked user agent Fixes openhab#15046 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Thomas Burri <thomas.burri@alstomgroup.com>
* Adapt blocked user agent Fixes openhab#15046 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Matt Myers <mmyers75@icloud.com>
* Adapt blocked user agent Fixes openhab#15046 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Fixes #15046
JAR for testing: