1234567891011121314151617181920 |
- from rest_framework.negotiation import BaseContentNegotiation
- class IgnoreClientContentNegotiation(BaseContentNegotiation):
- """
- @sentry/browser sends an interesting content-type of text/plain when it's actually sending json
- We have to ignore it and assume it's actually JSON
- """
- def select_parser(self, request, parsers):
- """
- Select the first parser in the `.parser_classes` list.
- """
- return parsers[0]
- def select_renderer(self, request, renderers, format_suffix):
- """
- Select the first renderer in the `.renderer_classes` list.
- """
- return (renderers[0], renderers[0].media_type)
|