From d268e3aab8d8851926a31fd75cac462a7b1bf443 Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 28 Feb 2013 20:48:12 -0300 Subject: Fix imports and typ0s. --- server.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 4d30a1f8..746dc8c0 100644 --- a/server.py +++ b/server.py @@ -7,6 +7,11 @@ This should be run with: import configparser from wsgiref.util import shift_path_info +import httplib +try: + import simplejson as json +except ImportError: + import json # noqa from twisted.web.wsgi import WSGIResource from twisted.internet import reactor @@ -52,7 +57,7 @@ class SoledadAuthMiddleware(object): return self._error(start_response, 400, "bad request") token = environ.get('HTTP_AUTHORIZATION') if not token: - if need_auth(environ): + if self.need_auth(environ): return self._error(start_response, 401, "unauthorized", "Missing Authentication Token.") else: @@ -89,8 +94,8 @@ def load_configuration(file_path): conf = { 'couch_url': 'http://localhost:5984', 'working_dir': '/tmp', - 'public_dbs': 'keys' - 'prefix': '/soledad/' + 'public_dbs': 'keys', + 'prefix': '/soledad/', } config = configparser.ConfigParser() config.read(file_path) -- cgit v1.2.3