Skip to content

Commit

Permalink
*) don't accept messages without subject or payload
Browse files Browse the repository at this point in the history
  • Loading branch information
theli committed May 19, 2006
1 parent 82b2bc6 commit fcec40f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion htroot/yacy/message.java
Expand Up @@ -121,8 +121,15 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
yacySeed otherSeed = yacySeed.genRemoteSeed(otherSeedString, key, true);

String subject = crypt.simpleDecode(post.get("subject", ""), key); // message's subject
subject = subject.trim();
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!");

// save message
Expand Down

0 comments on commit fcec40f

Please sign in to comment.