|
|
@ -30,6 +30,7 @@ import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import net.yacy.cora.document.MultiProtocolURI;
|
|
|
|
import net.yacy.cora.protocol.HeaderFramework;
|
|
|
|
import net.yacy.cora.protocol.HeaderFramework;
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
import net.yacy.document.ImageParser;
|
|
|
|
import net.yacy.document.ImageParser;
|
|
|
@ -46,12 +47,13 @@ public class cytag {
|
|
|
|
public static Image respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
|
|
|
|
public static Image respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
|
|
|
|
|
|
|
|
|
|
|
|
final Switchboard sb = (Switchboard)env;
|
|
|
|
final Switchboard sb = (Switchboard)env;
|
|
|
|
|
|
|
|
MultiProtocolURI referer = header.referer();
|
|
|
|
|
|
|
|
|
|
|
|
// harvest request information
|
|
|
|
// harvest request information
|
|
|
|
StringBuilder connect = new StringBuilder();
|
|
|
|
StringBuilder connect = new StringBuilder();
|
|
|
|
connect.append('{');
|
|
|
|
connect.append('{');
|
|
|
|
addJSON(connect, "time", DateFormatter.formatShortMilliSecond(new Date()));
|
|
|
|
addJSON(connect, "time", DateFormatter.formatShortMilliSecond(new Date()));
|
|
|
|
addJSON(connect, "trail", header.referer().toNormalform(false, false));
|
|
|
|
addJSON(connect, "trail", (referer == null) ? "" : referer.toNormalform(false, false));
|
|
|
|
addJSON(connect, "nick", (post == null) ? "" : post.get("nick", ""));
|
|
|
|
addJSON(connect, "nick", (post == null) ? "" : post.get("nick", ""));
|
|
|
|
addJSON(connect, "tag", (post == null) ? "" : post.get("tag", ""));
|
|
|
|
addJSON(connect, "tag", (post == null) ? "" : post.get("tag", ""));
|
|
|
|
addJSON(connect, "icon", (post == null) ? "" : post.get("icon", ""));
|
|
|
|
addJSON(connect, "icon", (post == null) ? "" : post.get("icon", ""));
|
|
|
@ -59,6 +61,7 @@ public class cytag {
|
|
|
|
addJSON(connect, "agent", header.get("User-Agent", ""));
|
|
|
|
addJSON(connect, "agent", header.get("User-Agent", ""));
|
|
|
|
connect.append('}');
|
|
|
|
connect.append('}');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sb.trail.size() >= 100) sb.trail.remove();
|
|
|
|
sb.trail.add(connect.toString());
|
|
|
|
sb.trail.add(connect.toString());
|
|
|
|
//Log.logInfo("CYTAG", "catched trail - " + connect.toString());
|
|
|
|
//Log.logInfo("CYTAG", "catched trail - " + connect.toString());
|
|
|
|
|
|
|
|
|
|
|
|