fixed authorization case

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4262 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 6a3a292015
commit ca488e03f5

@ -294,13 +294,13 @@ public final class httpd implements serverHandler {
} }
public static int staticAdminAuthenticated(String authorization, serverSwitch sw){ public static int staticAdminAuthenticated(String authorization, serverSwitch sw){
if(authorization==null) return 1; if (authorization==null) return 1;
//if (authorization.length() < 6) return 1; // no authentication information given //if (authorization.length() < 6) return 1; // no authentication information given
//authorization = authorization.trim().substring(6); //authorization = authorization.trim().substring(6);
String adminAccountBase64MD5 = sw.getConfig(ADMIN_ACCOUNT_B64MD5, ""); String adminAccountBase64MD5 = sw.getConfig(ADMIN_ACCOUNT_B64MD5, "");
if (adminAccountBase64MD5.length() == 0) return 2; // no passwrd stored if (adminAccountBase64MD5.length() == 0) return 2; // no passwrd stored
if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok
return 0; return 1;
} }
private boolean handleServerAuthentication(httpHeader header) throws IOException { private boolean handleServerAuthentication(httpHeader header) throws IOException {

Loading…
Cancel
Save