Skip to content

Conversation

lsiepel
Copy link
Contributor

@lsiepel lsiepel commented Aug 13, 2025

The deprecated new URL(String) points to URI.create(s).toURL() It only behaves slightly different.
The URI parsing is strict RFC 3986-compliant where the old URL parsing is lenient and accepts unencoded strings.

Unfortunately i do not know if the bindings actually have the need voor encoding and if they need further adjustments. Atleast http binding does.

Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM siemensrds

@lsiepel lsiepel marked this pull request as draft August 14, 2025 01:28
@jlaur
Copy link
Contributor

jlaur commented Aug 14, 2025

Unfortunately i do not know if the bindings actually have the need voor encoding and if they need further adjustments. Atleast http binding does.

Cool that you're doing this for all bindings. 👍 Some time ago I went binding by binding and paused/stopped my mission when I got to the http binding, which was not a 15 minute job, at least for me. 😄

@marcelrv
Copy link
Contributor

LGTM: for miio

@lsiepel
Copy link
Contributor Author

lsiepel commented Aug 14, 2025

Cool that you're doing this for all bindings. 👍 Some time ago I went binding by binding and paused/stopped my mission when I got to the http binding, which was not a 15 minute job, at least for me. 😄

Really cool.. until i discovered it wasn't a 15 minute job haha. I created a helper method to parse the string as URI.
Anyway, i like your advice. The http binding does some 'fuzzy' stuff with urlencode.

https://foöo.bar will be encoded to => https://xn--foo-tna.bar
As the ö (UTF8) is not allowed in URI hostnames, it needs to be encoded, but the URI method mentioned earlier does not do this for hosts, only for paths.
I would propose to no longer perform this escaping, and let the binding fail with a decent error message and let the user adapt the url themselves.

Another topic is if the helpermethod that is now inside the http binding should be extracted to core StringUtils so it will be available to all bindings. wdyt?

As i'm not german and my experience with umlauts are limited, maybe @holgerfriedrich can add something to the case?

@digitaldan
Copy link
Contributor

LGTM for venstarthermostat and openhabcloud 👍

@lsiepel
Copy link
Contributor Author

lsiepel commented Aug 30, 2025

Maybe @J-N-K can give some advice as i think he wrote the tests at the time for http?

@wborn wborn added the work in progress A PR that is not yet ready to be merged label Sep 8, 2025
Copy link
Contributor

@goopilot goopilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for folderwatcher

@lsiepel lsiepel removed the request for review from dominicdesu October 22, 2025 08:35
@lsiepel lsiepel force-pushed the deprecated-url branch 2 times, most recently from 3f60ab5 to 88b71b8 Compare October 22, 2025 08:42
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel marked this pull request as ready for review October 22, 2025 08:54
@lsiepel
Copy link
Contributor Author

lsiepel commented Oct 22, 2025

I removed http from this PR and will create another PR to no longer have this on hold.

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work in progress A PR that is not yet ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants