Replace URL with URI where possible

URL bad for anon and has traps like equals()
This commit is contained in:
zzz
2015-11-07 22:38:05 +00:00
parent 1e5a35c7f8
commit 8e77188560
12 changed files with 151 additions and 114 deletions

View File

@ -2,8 +2,8 @@ package net.i2p.router.web;
import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -37,10 +37,10 @@ public class ConfigReseedHandler extends FormHandler {
addFormError(_t("You must enter a URL"));
return;
}
URL url;
URI url;
try {
url = new URL(val);
} catch (MalformedURLException mue) {
url = new URI(val);
} catch (URISyntaxException mue) {
addFormError(_t("Bad URL {0}", val));
return;
}