forked from shaba/openuds
Fixed a couple bugs on rest when running under apache
This commit is contained in:
parent
8ed7bd1cc0
commit
ba1927b0fc
@ -86,12 +86,13 @@ class Dispatcher(View):
|
||||
return http.HttpResponseNotFound('method not found')
|
||||
|
||||
|
||||
# Guess content type from content type header or ".xxx" to method
|
||||
# Guess content type from content type header (post) or ".xxx" to method
|
||||
try:
|
||||
p = full_path.split('.')
|
||||
processor = processors.available_processors_ext_dict[p[1]](request)
|
||||
except:
|
||||
processor = processors.available_processors_mime_dict.get(request.META['CONTENT_TYPE'], processors.default_processor)(request)
|
||||
# TODO: Extract processor from accept and/or content type?
|
||||
processor = processors.available_processors_mime_dict.get(request.META.get('CONTENT_TYPE', 'json'), processors.default_processor)(request)
|
||||
|
||||
|
||||
# Obtain method to be invoked
|
||||
|
@ -99,4 +99,7 @@ class Providers(ModelHandler):
|
||||
|
||||
def allservices(self):
|
||||
for s in Service.objects.all():
|
||||
yield DetailServices.serviceToDict(s, True)
|
||||
try:
|
||||
yield DetailServices.serviceToDict(s, True)
|
||||
except:
|
||||
logger.exception('Passed service cause type is unknown')
|
||||
|
Loading…
Reference in New Issue
Block a user