fix for ViewFile

pull/1/head
Michael Peter Christen 12 years ago
parent 4b5e0c1500
commit 554db5608b

@ -115,25 +115,21 @@ public class ViewFile {
// get the url hash from which the content should be loaded // get the url hash from which the content should be loaded
String urlHash = post.get("urlHash", post.get("urlhash", "")); String urlHash = post.get("urlHash", post.get("urlhash", ""));
if (urlHash.length() == 0) { final String urlString = post.get("url", "");
// alternatively, get the url simply from a url String if (urlString.length() > 0) try {
// this can be used as a simple tool to test the text parser // this call forces the peer to download web pages
final String urlString = post.get("url", ""); // it is therefore protected by the admin password
if (urlString.length() > 0) try {
// this call forces the peer to download web pages
// it is therefore protected by the admin password
if (!sb.verifyAuthentication(header)) {
prop.authenticationRequired();
return prop;
}
// define an url by post parameter if (!sb.verifyAuthentication(header)) {
url = new DigestURI(MultiProtocolURI.unescape(urlString)); prop.authenticationRequired();
urlHash = ASCII.String(url.hash()); return prop;
pre = post.getBoolean("pre"); }
} catch (final MalformedURLException e) {}
} // define an url by post parameter
url = new DigestURI(MultiProtocolURI.unescape(urlString));
urlHash = ASCII.String(url.hash());
pre = post.getBoolean("pre");
} catch (final MalformedURLException e) {}
URIMetadata urlEntry = null; URIMetadata urlEntry = null;
// get the urlEntry that belongs to the url hash // get the urlEntry that belongs to the url hash

Loading…
Cancel
Save