Skip to content

Commit

Permalink
correct blacklist export as text url to blacklists_p.txt
Browse files Browse the repository at this point in the history
was using servlet for network access and missing network.unit.name
fix for http://mantis.tokeek.de/view.php?id=694
+ prevent unresoved_pattern in yacy/list servlet
  • Loading branch information
reger committed Oct 7, 2016
1 parent b752bcf commit 7c81160
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion htroot/BlacklistImpExp_p.html
Expand Up @@ -80,7 +80,7 @@ <h2>Blacklist Import</h2>
</fieldset>
</form>

<form action="yacy/list.html" method="get" accept-charset="UTF-8">
<form action="api/blacklists_p.txt" method="get" accept-charset="UTF-8">
<fieldset>
<legend>plain text file:</legend>
Here you can export a blacklist as a regular text file with one blacklist entry per line.
Expand Down
4 changes: 4 additions & 0 deletions htroot/api/blacklists_p.txt
@@ -0,0 +1,4 @@
#{lists}#
#{items}##[item]#
#{/items}#
#{/lists}#
5 changes: 2 additions & 3 deletions htroot/yacy/list.java
Expand Up @@ -51,6 +51,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje

// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
prop.put("list", ""); // init a empty return (error case)
if ((post == null) || (env == null)) return prop;
if (!Protocol.authentifyRequest(post, env)) return prop;

Expand All @@ -66,7 +67,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje

if ((sb.isRobinsonMode()) && (!sb.isInMyCluster(otherPeerName))) {
// if we are a robinson cluster, answer only if this client is known by our network definition
return null;
return prop;
}

if (col.equals("black")) {
Expand All @@ -85,8 +86,6 @@ public static serverObjects respond(final RequestHeader header, final serverObje
}

prop.put("list",out.toString());
} else {
prop.put("list","");
}

return prop;
Expand Down

0 comments on commit 7c81160

Please sign in to comment.