commit 9d665ad2a41576357e15b77dab11b0429a84b553 Author: Karsten Loesing karsten.loesing@gmx.net Date: Mon Jun 3 04:38:29 2013 +0200
Work around corrupt details files.
It's yet unclear what causes the back-end to write corrupt details files, but the front-end shouldn't serve corrupt responses in any case. --- src/org/torproject/onionoo/ResourceServlet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/org/torproject/onionoo/ResourceServlet.java b/src/org/torproject/onionoo/ResourceServlet.java index 8a1bd0c..75c2ac4 100644 --- a/src/org/torproject/onionoo/ResourceServlet.java +++ b/src/org/torproject/onionoo/ResourceServlet.java @@ -921,7 +921,10 @@ public class ResourceServlet extends HttpServlet { if (line != null) { sb.append("{"); while ((line = br.readLine()) != null) { - if (!line.startsWith(""desc_published":")) { + if (line.equals("}")) { + sb.append("}\n"); + break; + } else if (!line.startsWith(""desc_published":")) { sb.append(line + "\n"); } }