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
Pasting that into a browser gives an error saying "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used."
Looks like they're doing stupid user-agent filtering, as passing a different user-agent header returns a 200 response.
Seems any user-agent string with 'curl' or 'python' (or 'ruby', even) in it results in a 403:
$ printf '%-32s %s\n' user-agent response; for agent in web-enabled-hair-{straighteners,curlers} 'some script written in '{ruby,python,bash} ; do printf '%-32s ' "${agent}"; curl -s -o /dev/null -w '%{http_code}\n' -A "$agent" 'https://lewisham.gov.uk/myservices/recycling-and-rubbish/your-bins/collection' ; d
one
user-agent response
web-enabled-hair-straighteners 200
web-enabled-hair-curlers 403
some script written in ruby 403
some script written in python 403
some script written in bash 200
Source (if relevant)
lewisham_gov_uk
Logs
no relevant logs
Relevant Configuration
No response
Checklist Source Error
Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
Checked that the website of your service provider is still working
Tested my attributes on the service provider website (if possible)
I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)
Checklist Sensor Error
Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)
Required
I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
The text was updated successfully, but these errors were encountered:
This seems not to be the only issue, If you pass another user agent the first requests pass as expected but requesting https://lewisham.gov.uk/formbuilder?sc_site=website&fxb.FormItemId=cc81fd29-2b6b-4087-a5a9-e62d90ae8d74&fxb.HtmlPrefix=fxb.aa57bdc7-9d26-41f3-aee1-39a061d62d3c fails with 403 Forbidden I did some tinkering but could not figure out what's wrong. I think I did everything exactly like the browser, but the script still fails (I probably did not see some small thing somewhere in the request). I will take a second look at this tomorrow.
This will be part of the next release or is available now as master (git) version
install master/git: Developer tools -> actions -> select update: Install update -> click Coose entity and select WCS -> select version and type master in the input field -> run the action -> restart HA
Older versions of HACS:
install master with HACS version < 2.0: (3-dot menu -> redownload -> change version to master -> fully restart HA (this will increase update cycle by a lot)
I Have A Problem With:
A specific source
What's Your Problem
Trying to configure the source with UPRN, I get this error:
Pasting that URL into a browser works fine.
Trying postcode+number instead of UPRN, I get the same error with a different URL:
Pasting that into a browser gives an error saying "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used."
Trying either URL via
curl
I get a 403, eg:Looks like they're doing stupid user-agent filtering, as passing a different user-agent header returns a 200 response.
Seems any user-agent string with 'curl' or 'python' (or 'ruby', even) in it results in a 403:
Source (if relevant)
lewisham_gov_uk
Logs
Relevant Configuration
No response
Checklist Source Error
Checklist Sensor Error
Required
The text was updated successfully, but these errors were encountered: