Ejemplo n.º 1
0
Archivo: server.py Proyecto: omps/pulp
 def _process_body(self, body):
     """
     Process the request body, ensuring the proper encoding.
     @param body: request body to process
     @return: properly encoded request body
     """
     if isinstance(body, (list, set, tuple)):
         return [self._process_body(b) for b in body]
     elif isinstance(body, dict):
         return dict((self._process_body(k), self._process_body(v)) for k, v in body.items())
     return ensure_utf_8(body)
Ejemplo n.º 2
0
 def _process_body(self, body):
     """
     Process the request body, ensuring the proper encoding.
     @param body: request body to process
     @return: properly encoded request body
     """
     if isinstance(body, (list, set, tuple)):
         return [self._process_body(b) for b in body]
     elif isinstance(body, dict):
         return dict((self._process_body(k), self._process_body(v)) for k, v in body.items())
     return ensure_utf_8(body)