From d7a3fdb18be35463c05dc4400adb147d3ae44fb5 Mon Sep 17 00:00:00 2001 From: allo Date: Mon, 12 Jun 2006 12:12:21 +0000 Subject: [PATCH] no white pages, when clicking cancel on the password-dialog git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2198 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/proxymsg/authfail.inc | 1 + source/de/anomic/http/httpd.java | 14 +++++++++----- source/de/anomic/http/httpdFileHandler.java | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 htroot/proxymsg/authfail.inc diff --git a/htroot/proxymsg/authfail.inc b/htroot/proxymsg/authfail.inc new file mode 100644 index 000000000..c6ea7ae1d --- /dev/null +++ b/htroot/proxymsg/authfail.inc @@ -0,0 +1 @@ +Your Username/Password is wrong. \ No newline at end of file diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java index 2b37de81b..ead72db1f 100644 --- a/source/de/anomic/http/httpd.java +++ b/source/de/anomic/http/httpd.java @@ -992,7 +992,8 @@ public final class httpd implements serverHandler { detailedErrorMsg, null, null, - stackTrace + stackTrace, + null ); } @@ -1014,11 +1015,12 @@ public final class httpd implements serverHandler { null, detailedErrorMsgFile, detailedErrorMsgValues, - stackTrace + stackTrace, + null ); } - private static final void sendRespondError( + public static final void sendRespondError( Properties conProp, OutputStream respond, int errorcase, @@ -1027,7 +1029,8 @@ public final class httpd implements serverHandler { String detailedErrorMsgText, Object detailedErrorMsgFile, serverObjects detailedErrorMsgValues, - Exception stackTrace + Exception stackTrace, + httpHeader header ) throws IOException { FileInputStream fis = null; @@ -1144,7 +1147,8 @@ public final class httpd implements serverHandler { byte[] result = o.toByteArray(); o.close(); o = null; - httpHeader header = new httpHeader(); + if(header == null) + header = new httpHeader(); header.put(httpHeader.DATE, systemDate); header.put(httpHeader.CONTENT_TYPE, "text/html"); header.put(httpHeader.CONTENT_LENGTH, Integer.toString(result.length)); diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index abdb4e1d1..b3d625be4 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -322,7 +322,8 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http // no authorization given in response. Ask for that httpHeader headers = getDefaultHeaders(path); headers.put(httpHeader.WWW_AUTHENTICATE,"Basic realm=\"admin log-in\""); - httpd.sendRespondHeader(conProp,out,httpVersion,401,headers); + //httpd.sendRespondHeader(conProp,out,httpVersion,401,headers); + httpd.sendRespondError(conProp, out, 5, 401, "Wrong Authentication", "", new File("proxymsg/authfail.inc"), new serverObjects(), null, headers); return; }