*) Removed base tag from errror page. This has been added by myself a long time ago as a workaround for some weird behavior of my router, but as it turns out, it does more bad than good in general: If HTTPS is used for communication with YaCy, entering a wrong passwort led to an errror page with a form which would send username and password unencrypted with the user possibly being unaware of this.

*) changed some comments, added some annotations, added SVN properties here and there

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6340 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
low012 2009-09-23 21:26:14 +00:00
parent e4797ebcde
commit f65bfaa9af
19 changed files with 60 additions and 66 deletions

View File

@ -1,7 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="http://#[extAddress]#" />
<title>YaCy: Error Message</title>
#%env/templates/metas.template%#
</head>

View File

@ -1,4 +1,4 @@
// CrawlerWorker.java
// FTPLoader.java
// -------------------------------------
// part of YACY
// (C) by Michael Peter Christen; mc@yacy.net

View File

@ -1,13 +1,13 @@
//plasmaCrawlWorker.java
//HTTPLoader.java
//------------------------
//part of YaCy
//(C) by Michael Peter Christen; mc@yacy.net
//first published on http://www.anomic.de
//Frankfurt, Germany, 2006
//
// $LastChangedDate: 2006-08-12 16:28:14 +0200 (Sa, 12 Aug 2006) $
// $LastChangedRevision: 2397 $
// $LastChangedBy: theli $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by

View File

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

View File

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

View File

@ -1,12 +1,12 @@
// httpdProxyCacheEntry.java
// Response.java
// (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 19.08.2008 on http://yacy.net
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

View File

@ -62,7 +62,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
static final String DEFAULT_CHARSET = "ISO-8859-1";
/* =============================================================
/* =============================================================
* Constants defining http versions
* ============================================================= */
public static final String HTTP_VERSION_0_9 = "HTTP/0.9";
@ -245,6 +245,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
// we override the put method to make use of the reverseMappingCache
@Override
public String put(final String key, final String value) {
final String upperK = key.toUpperCase();
@ -311,6 +312,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
}
}
@Override
public String toString() {
return super.toString();
}

View File

@ -4,8 +4,8 @@
// first published on http://yacy.net
// Frankfurt, Germany, 22.08.2008
//
// last major change: $LastChangedDate: 2008-08-20 09:54:56 +0200 (Mi, 20 Aug 2008) $ by $LastChangedBy: danielr $
// Revision: $LastChangedRevision: 5063 $
// last major change: $LastChangedDate$ by $LastChangedBy$
// Revision: $LastChangedRevision$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2008-03-14 01:16:04 +0100 (Fr, 14 Mrz 2008) $
// $LastChangedRevision: 4558 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
@ -181,6 +181,7 @@ public class ResponseContainer {
*
* @see java.lang.Object#finalize()
*/
@Override
protected void finalize() {
closeStream();
}

View File

@ -1,11 +1,11 @@
// httpResponseHeader.java
// ResponseHeader.java
// -----------------------
// (C) 2008 by Michael Peter Christen; mc@yacy.net
// first published on http://yacy.net
// Frankfurt, Germany, 22.08.2008
//
// last major change: $LastChangedDate: 2008-08-20 09:54:56 +0200 (Mi, 20 Aug 2008) $ by $LastChangedBy: danielr $
// Revision: $LastChangedRevision: 5063 $
// last major change: $LastChangedDate$ by $LastChangedBy$
// Revision: $LastChangedRevision$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@ -2,9 +2,9 @@
// (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 05.05.2008 on http://yacy.net
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

View File

@ -1,11 +1,12 @@
// httpdFileHandler.java
// HTTPDFileHandler.java
// -----------------------
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004, 2005
// last major change: 01.01.2009
//
// CGI additions by Marc Nause
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
// httpdProxyHandler.java
// HTTPDProxyHandler.java
// (C) 2004 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 2004 on http://yacy.net
//
@ -1327,6 +1327,7 @@ public final class HTTPDProxyHandler {
this.socket = socket;
}
@Override
public void run() {
final byte[] buffer = new byte[512];
int len;

View File

@ -1,4 +1,4 @@
// httpd.java
// HTTPDemon.java
// -----------------------
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
@ -133,7 +133,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {
// for authentication
private boolean use_proxyAccounts = false;
private boolean proxyAccounts_init = false; // is use_proxyAccounts set?
private boolean proxyAccounts_init = false; // is use_proxyAccounts set?
private String serverAccountBase64MD5;
private String clientIP;
private boolean allowProxy;
@ -1144,9 +1144,6 @@ public final class HTTPDemon implements serverHandler, Cloneable {
// set rewrite values
final serverObjects tp = new serverObjects();
// tp.put("host", serverCore.publicIP().getHostAddress());
// tp.put("port", switchboard.getConfig("port", "8080"));
final String clientIP = conProp.getProperty(HeaderFramework.CONNECTION_PROP_CLIENTIP, "127.0.0.1");
// check if ip is local ip address
@ -1162,15 +1159,6 @@ public final class HTTPDemon implements serverHandler, Cloneable {
tp.put("port", Integer.toString(serverCore.getPortNr(switchboard.getConfig("port", "8080"))));
}
// if peer has public address it will be used
if (getAlternativeResolver() != null) {
tp.put("extAddress", getAlternativeResolver().myIP() + ":" + getAlternativeResolver().myPort());
}
// otherwise the local ip address will be used
else {
tp.put("extAddress", tp.get("host", "127.0.0.1") + ":" + tp.get("port", "8080"));
}
tp.put("peerName", (getAlternativeResolver() == null) ? "" : getAlternativeResolver().myName());
tp.put("errorMessageType", errorcase);
tp.put("httpStatus", Integer.toString(httpStatusCode) + " " + httpStatusText);

View File

@ -1,4 +1,4 @@
//severMiniLogFormatter.java
//ProxyLogFormatter.java
//-------------------------------------
//part of YACY
//(C) by Michael Peter Christen; mc@yacy.net
@ -6,8 +6,8 @@
//Frankfurt, Germany, 2004
//
//This file ist contributed by Martin Thelian
//last major change: $LastChangedDate: 2008-12-04 12:54:16 +0000 (Do, 04 Dez 2008) $ by $LastChangedBy: orbiter $
//Revision: $LastChangedRevision: 5379 $
//last change: $LastChangedDate$ by $LastChangedBy$
//Revision: $LastChangedRevision$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@ -36,17 +36,18 @@ public final class ProxyLogFormatter extends SimpleFormatter {
super();
}
@Override
public synchronized String format(final LogRecord record) {
final StringBuilder buffer = this.buffer;
buffer.setLength(0);
final StringBuilder sb = this.buffer;
sb.setLength(0);
buffer.append(formatMessage(record));
sb.append(formatMessage(record));
// adding the stack trace if available
buffer.append(System.getProperty("line.separator"));
sb.append(System.getProperty("line.separator"));
return buffer.toString();
return sb.toString();
}
}

View File

@ -1,4 +1,4 @@
// httpdRobotsTxtConfig.java
// RobotsTxtConfig.java
// ---------
// part of YaCy
// (C) by Michael Peter Christen; mc@yacy.net
@ -8,9 +8,9 @@
//
// This file is contributed by Franz Brausze
//
// $LastChangedDate: $
// $LastChangedRevision: $
// $LastChangedBy: $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -89,6 +89,7 @@ public final class RobotsTxtConfig {
return new RobotsTxtConfig(cfg.split(","));
}
@Override
public String toString() {
if (this.allDisallowed) return ALL;
final StringBuilder sb = new StringBuilder();

View File

@ -1,13 +1,13 @@
// httpSSI.java
// ServerSideIncludes.java
// -----------------------------
// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 26.06.2007 on http://yacy.net
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//

View File

@ -1,4 +1,4 @@
//httpTemplate.java
//TemplateEngine.java
//-------------------------------------
//(C) by Michael Peter Christen; mc@yacy.net
//first published on http://www.anomic.de