Open dmitrilc opened 2 years ago
The method RouteConfiguration.forSessionScope().getUrl() only returns the route parameter and not a valid URL.
Just a small nitpick, it returns the route (the one we define using @Route
), not the route parameter.
And for the record, the scheme + host URL is already retrievable using UI.getCurrent().getPage().fetchCurrentURL()
. I think it would be better to rename RouteConfiguration.getUrl()
to RouteConfiguration.getRoute()
.
In which case do you need the full URL?
The proxy case always complicates things where the user might be accessing the app through https://some.url/some/path and the server might be running on http://localhost:8080/something/else
@dmitrilc can correct me if I'm wrong, but we are raising this issue from a purely academic standpoint. We just think that RouteConfiguration.getUrl()
should be renamed to better indicate the returned value.
@dmitrilc can correct me if I'm wrong, but we are raising this issue from a purely academic standpoint. We just think that
RouteConfiguration.getUrl()
should be renamed to better indicate the returned value.
That is correct.
And for the record, the scheme + host URL is already retrievable using
UI.getCurrent().getPage().fetchCurrentURL()
. I think it would be better to renameRouteConfiguration.getUrl()
toRouteConfiguration.getRoute()
.
There are already getRoute()
methods in RouteConfiguration
. Maybe it should be called getRouteString()
or something similar.
the route and not a valid URL
Not that it really matters in this case, but it could be noted that relative URLs are still valid URLs.
Description of the bug
The method
RouteConfiguration.forSessionScope().getUrl()
only returns the route and not a valid URL.Expected behavior
Since the method
RouteConfiguration.forSessionScope().getUrl()
is namedgetUrl()
, I expected it to return at least the scheme + hosthttps://datatracker.ietf.org/doc/html/rfc1738#section-3.3
Minimal reproducible example
Versions