Commit 5662c79a authored by Vincent Pelletier's avatar Vincent Pelletier

wsgi: Prepare routing dict for extension.

parent e1233c9d
...@@ -125,16 +125,28 @@ class Application(object): ...@@ -125,16 +125,28 @@ class Application(object):
} }
self._routing_dict = { self._routing_dict = {
'crl': { 'crl': {
'GET': self.getCRL, 'GET': {
'method': self.getCRL,
},
}, },
'csr': { 'csr': {
'GET': self.getCSR, 'GET': {
'PUT': self.putCSR, 'method': self.getCSR,
'DELETE': self.deleteCSR, },
'PUT': {
'method': self.putCSR,
},
'DELETE': {
'method': self.deleteCSR,
},
}, },
'crt': { 'crt': {
'GET': self.getCRT, 'GET': {
'PUT': self.putCRT, 'method': self.getCRT,
},
'PUT': {
'method': self.putCRT,
},
}, },
} }
...@@ -162,10 +174,10 @@ class Application(object): ...@@ -162,10 +174,10 @@ class Application(object):
result = [] result = []
else: else:
try: try:
method = method_dict[request_method] entry = method_dict[request_method]
except KeyError: except KeyError:
raise BadMethod raise BadMethod
status, header_list, result = method(context, environ, path_item_list[2:]) status, header_list, result = entry['method'](context, environ, path_item_list[2:])
except ApplicationError: except ApplicationError:
raise raise
except exceptions.NotFound: except exceptions.NotFound:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment