Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apiFetch: Use URL computation in
apiFetch
.
For #4146, but also to fix a recent regression from 865914f. The URL constructor already throws a special "Invalid URL" error if it can't put together a valid URL from the inputs, so, nicely, we get to remove the `isValidUrl` call site. `isValidUrl` failed to alert us of a double-forward-slash issue in this string concatenation: the realm gained a trailing slash in its new spelling as `realm.origin` from 865914f, and we kept the leading slash in what we were adding to the end of the realm. This is a sign that `isValidUrl` should be retired ASAP; we'll do that in an upcoming commit.
- Loading branch information