Request bug
YFCOM opened this issue · comments
public Request.Builder url(String url) {
if (url == null) {
throw new NullPointerException("url == null");
} else {
if (url.regionMatches(true, 0, "ws:", 0, 3)) {
url = "http:" + url.substring(3);
} else if (url.regionMatches(true, 0, "wss:", 0, 4)) {
url = "https:" + url.substring(4);
}
HttpUrl parsed = HttpUrl.parse(url);
if (parsed == null) {
throw new IllegalArgumentException("unexpected url: " + url);
} else {
return this.url(parsed);
}
}
}
HttpUrl parsed = HttpUrl.parse(url); when url is a string like "/et/appCenterEventTracking" will throw IllegalArgumentException("unexpected url: " + url). This is unreasonable,this issue is v3.8.1
This is by design, HttpUrl is a strict implementation of Http URLs, not a general URL/URI class that can handle anything.