[tor-commits] [bridgedb/develop] Fix an error in HTTPServer.py with requests for bridges?format=plain.

isis at torproject.org isis at torproject.org
Fri May 8 23:41:50 UTC 2015


commit 28ea3c489c945f954e99bd996bb24bd879fb817e
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri May 8 23:27:05 2015 +0000

    Fix an error in HTTPServer.py with requests for bridges?format=plain.
---
 lib/bridgedb/HTTPServer.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 2e0398c..42e1c54 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -770,7 +770,10 @@ class WebResourceBridges(resource.Resource):
 
         if format == 'plain':
             request.setHeader("Content-Type", "text/plain")
-            rendered = bridgeLines
+            try:
+                rendered = bytes(bridgeLines)
+            except Exception as err:
+                rendered = replaceErrorPage(err)
         else:
             request.setHeader("Content-Type", "text/html; charset=utf-8")
             qrcode = None





More information about the tor-commits mailing list