Merged in cmcdaniel/wsme/json_strictness (pull request #8: rest protocol detection: test Accept header first; use startswith for Content-Type match)
This commit is contained in:
commit
24675e4a8e
@ -35,7 +35,12 @@ class RestProtocol(Protocol):
|
||||
for dataformat in self.dataformats:
|
||||
if request.path.endswith('.' + dataformat):
|
||||
return True
|
||||
return request.headers.get('Content-Type') in self.content_types
|
||||
if request.headers.get('Accept') in self.content_types:
|
||||
return True
|
||||
for ct in self.content_types:
|
||||
if request.headers['Content-Type'].startswith(ct):
|
||||
return True
|
||||
return False
|
||||
|
||||
def iter_calls(self, request):
|
||||
context = CallContext(request)
|
||||
|
Loading…
x
Reference in New Issue
Block a user