mirror of
https://github.com/TrianguloY/UrlChecker.git
synced 2024-09-20 04:12:14 +02:00
Fixed null when there is no authority
Added additional comments.
This commit is contained in:
parent
ea0a20ddfe
commit
a7b2b53c46
@ -71,12 +71,18 @@ class RemoveQueriesDialog extends AModuleDialog implements View.OnClickListener
|
||||
URL urlObject = null;
|
||||
try {
|
||||
urlObject = new URL(url);
|
||||
|
||||
//retrieve all components
|
||||
String protocol = urlObject.getProtocol();
|
||||
protocol = protocol + ":";
|
||||
String authority = urlObject.getAuthority();
|
||||
authority = authority != null ? "//" + authority : "";
|
||||
String path = urlObject.getPath();
|
||||
String ref = urlObject.getRef();
|
||||
ref = ref != null ? "#" + ref : "";
|
||||
cleared = protocol + "://" + authority + path + ref;
|
||||
|
||||
//create the url but without queries
|
||||
cleared = protocol + authority + path + ref;
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user