From 554db5608b5384bdb378c5bc410214b25b0a77c6 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 9 Oct 2012 11:25:05 +0200 Subject: [PATCH] fix for ViewFile --- htroot/ViewFile.java | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java index aa4807fe6..c554c8f8b 100644 --- a/htroot/ViewFile.java +++ b/htroot/ViewFile.java @@ -115,25 +115,21 @@ public class ViewFile { // get the url hash from which the content should be loaded String urlHash = post.get("urlHash", post.get("urlhash", "")); - if (urlHash.length() == 0) { - // alternatively, get the url simply from a url String - // this can be used as a simple tool to test the text parser - final String urlString = post.get("url", ""); - 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; - } + final String urlString = post.get("url", ""); + if (urlString.length() > 0) try { + // this call forces the peer to download web pages + // it is therefore protected by the admin password - // 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) {} - } + if (!sb.verifyAuthentication(header)) { + prop.authenticationRequired(); + return prop; + } + + // 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; // get the urlEntry that belongs to the url hash