From 8fa4a01c38b66b578cc188869750136c49322827 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 23 Nov 2006 17:13:25 +0000 Subject: [PATCH] added password check to url retrieval in FiewFile git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3002 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ViewFile.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java index 5077a0d06..c090bb06b 100644 --- a/htroot/ViewFile.java +++ b/htroot/ViewFile.java @@ -130,6 +130,15 @@ public class ViewFile { // this can be used as a simple tool to test the text parser 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, false)) { + prop.put("AUTHENTICATE", "admin log-in"); // force log-in + return prop; + } + + // define an url by post parameter url = new URL(urlString); } catch (MalformedURLException e) {}