diff options
| author | drebs <drebs@leap.se> | 2013-02-28 20:48:12 -0300 | 
|---|---|---|
| committer | drebs <drebs@leap.se> | 2013-02-28 20:48:12 -0300 | 
| commit | d268e3aab8d8851926a31fd75cac462a7b1bf443 (patch) | |
| tree | c9ebcf22bbd3bddc3834968f78de3e98e9086ea3 | |
| parent | e42cd8a3de303759e38a5140b43a5b38bb80a5d9 (diff) | |
Fix imports and typ0s.
| -rw-r--r-- | server.py | 11 | 
1 files changed, 8 insertions, 3 deletions
| @@ -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) | 
