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
the JS API supports URLs like /path but also path or ../path. It's not possible to do with this library because Request forces you to have scheme and host.
You can set up a request with host set as the empty string but that doesn't work because the conversion of the request to string url results in https:///path which is an invalid URL. If the conversion resulted in https:/path it would have been better, as this is valid, but it's still not great forcing you to detect the scheme.
It's true that you can workaround this using FFI or an external library to get location and path, but it's a bit cumbersome, especially when relative paths like ../path come into play, then you also have to write code to manipulate the path.
Maybe this issue brings to light an underlying problem with the Request type or its conversion to Uri and then to string, but if so, I wouldn't know how could these be fixed in a backward compatible way.
The text was updated successfully, but these errors were encountered:
the JS API supports URLs like
/path
but alsopath
or../path
. It's not possible to do with this library because Request forces you to have scheme and host.You can set up a request with host set as the empty string but that doesn't work because the conversion of the request to string url results in
https:///path
which is an invalid URL. If the conversion resulted inhttps:/path
it would have been better, as this is valid, but it's still not great forcing you to detect the scheme.It's true that you can workaround this using FFI or an external library to get location and path, but it's a bit cumbersome, especially when relative paths like
../path
come into play, then you also have to write code to manipulate the path.Maybe this issue brings to light an underlying problem with the Request type or its conversion to Uri and then to string, but if so, I wouldn't know how could these be fixed in a backward compatible way.
The text was updated successfully, but these errors were encountered: