Open alexkalderimis opened 11 years ago
I think
if not request.accept_mimetypes.best_match(content_types):
raise NotAcceptable()
might be enough to handle this.
I think
if not request.accept_mimetypes.best_match(content_types): raise NotAcceptable()
might be enough to handle this.
this totally worked for me - ty!
The current implementation only permits exact matches on mimetype strings, whereas Accept headers may contain wild cards (such as
text/*
, up to*/*
). This pull request includes tests, code and documentation to add the capacity to deal with wildcards. All current tests remain as they were, so the current behaviour should not break for anyone. I have also bumped the minor version to reflect the API change.