[or-cvs] r19324: {bridgedb} fewer tracebacks this way (bridgedb/trunk/lib/bridgedb)
arma at seul.org
arma at seul.org
Tue Apr 14 20:29:00 UTC 2009
Author: arma
Date: 2009-04-14 16:29:00 -0400 (Tue, 14 Apr 2009)
New Revision: 19324
Modified:
bridgedb/trunk/lib/bridgedb/Server.py
Log:
fewer tracebacks this way
Modified: bridgedb/trunk/lib/bridgedb/Server.py
===================================================================
--- bridgedb/trunk/lib/bridgedb/Server.py 2009-04-14 19:52:12 UTC (rev 19323)
+++ bridgedb/trunk/lib/bridgedb/Server.py 2009-04-14 20:29:00 UTC (rev 19324)
@@ -103,6 +103,7 @@
ip = request.getClientIP()
format = request.args.get("format", None)
+ if format and len(format): format = format[0] # choose the first arg
if ip:
bridges = self.distributor.getBridgesForIP(ip, interval,
@@ -115,7 +116,7 @@
logging.info("Replying to web request from %s. Parameters were %r", ip,
request.args)
if format == 'plain':
- request.setHeader("Content-Type: text/plain")
+ request.setHeader("Content-Type", "text/plain")
return answer
else:
return HTML_MESSAGE_TEMPLATE % answer
More information about the tor-commits
mailing list