Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
consolidate all servlets into one. this makes URL's more RESTful and …
…the Python path manipulation simpler.
  • Loading branch information
Robert Newson committed Mar 21, 2010
1 parent 2eff6f5 commit 18b332e
Show file tree
Hide file tree
Showing 8 changed files with 566 additions and 691 deletions.
13 changes: 4 additions & 9 deletions couchdb-external-hook.py
Expand Up @@ -58,19 +58,14 @@ def respond(res, req, key):

# Drop name of external hook.
del path[1]

# URL-escape each part
for index, item in enumerate(path):
path[index] = urllib.quote(path[index], "")

if len(path) == 3:
if req["query"] == {}:
path = '/'.join(['', 'info', key] + path)
else:
path = '/'.join(['', 'search', key] + path)
params = urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in req["query"].items()))
path = '?'.join([path, params])
else:
path = '/'.join(['', 'admin', key] + path)
path = '/'.join(['', key] + path)
params = urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in req["query"].items()))
path = '?'.join([path, params])

req_headers = {}
for h in req.get("headers", []):
Expand Down
178 changes: 0 additions & 178 deletions src/main/java/com/github/rnewson/couchdb/lucene/AdminServlet.java

This file was deleted.

109 changes: 0 additions & 109 deletions src/main/java/com/github/rnewson/couchdb/lucene/InfoServlet.java

This file was deleted.

0 comments on commit 18b332e

Please sign in to comment.