Permalink
Browse files

url escape query parameters.

  • Loading branch information...
1 parent 06cec8f commit 9e37cdbfac2c272e94b319ded84991162cc23a1e Robert Newson committed Oct 8, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 couchdb-external-hook.py
View
@@ -1,6 +1,7 @@
#!/usr/bin/python
import sys
+import urllib
import httplib
try:
@@ -24,7 +25,7 @@ def respond(req):
url = "/search/%s/%s/%s?" % (path[0],path[1],path[2])
for key in req["query"]:
- url += "%s=%s&" % (key, req["query"][key])
+ url += "%s=%s&" % (key, urllib.quote(req["query"][key]))
conn = httplib.HTTPConnection('localhost', 5985)
if "Accept-Encoding" in req["headers"]:
del req["headers"]["Accept-Encoding"]

0 comments on commit 9e37cdb

Please sign in to comment.