Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle case where no args are passed.

  • Loading branch information...
commit 8fb2c1cd8ea7ddc49b443740d2edbd49daa190f1 1 parent 0438a1e
@rnewson authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 couchdb-external-hook.py
View
16 couchdb-external-hook.py
@@ -72,16 +72,16 @@ def respond(res, req, line, key):
# Use regexps to extract query arguments so we can tolerate duplicate keys.
query = query_re.search(line)
+ if query is not None:
+ # Make 2-tuples
+ args = arg_re.findall(query.group(1))
- # Make 2-tuples
- args = arg_re.findall(query.group(1))
+ # unquote tuples
+ args = [(k.strip('"'), v.strip('"')) for (k, v) in args]
- # unquote tuples
- args = [(k.strip('"'), v.strip('"')) for (k, v) in args]
-
- # urlencode the arguments
- params = urllib.urlencode(args)
- path = '?'.join([path, params])
+ # urlencode the arguments
+ params = urllib.urlencode(args)
+ path = '?'.join([path, params])
req_headers = {}
for h in req.get("headers", []):
Please sign in to comment.
Something went wrong with that request. Please try again.