[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 28ea3c489c945f954e99bd996bb24bd879fb817e
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits