예제 #1
0
파일: wsgi.py 프로젝트: ovo-6/murano
    def get_content_type(self, allowed_content_types=None):
        """Determine content type of the request body.

        Does not do any body introspection, only checks header

        """
        if "Content-Type" not in self.headers:
            return None

        content_type = self.content_type
        allowed_content_types = (allowed_content_types
                                 or self.default_request_content_types)

        if content_type not in allowed_content_types:
            raise exception.InvalidContentType(content_type=content_type)
        return content_type
예제 #2
0
파일: wsgi.py 프로젝트: ovo-6/murano
 def get_body_deserializer(self, content_type):
     try:
         return self.body_deserializers[content_type]
     except (KeyError, TypeError):
         raise exception.InvalidContentType(content_type=content_type)