*) don't accept messages without subject or payload

See: http://www.yacy-forum.de/viewtopic.php?p=21656

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2115 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2006-05-19 11:57:17 +00:00
parent 82b2bc6932
commit fcec40fcc6

View File

@ -121,8 +121,15 @@ public final class message {
yacySeed otherSeed = yacySeed.genRemoteSeed(otherSeedString, key, true); yacySeed otherSeed = yacySeed.genRemoteSeed(otherSeedString, key, true);
String subject = crypt.simpleDecode(post.get("subject", ""), key); // message's subject String subject = crypt.simpleDecode(post.get("subject", ""), key); // message's subject
subject = subject.trim();
String message = crypt.simpleDecode(post.get("message", ""), key); // message body String message = crypt.simpleDecode(post.get("message", ""), key); // message body
message = message.trim();
if (subject.length() == 0 && message.length() == 0) {
prop.put("response", "-1"); // don't accept empty messages
return prop;
}
prop.put("response", "Thank you!"); prop.put("response", "Thank you!");
// save message // save message