示例#1
0
 def _pack(self, body, content_type, content_encoding, signer, signature,
           sep=str_to_bytes('\x00\x01')):
     fields = sep.join(
         ensure_bytes(s) for s in [signer, signature, content_type,
                                   content_encoding, body]
     )
     return b64encode(fields)
示例#2
0
 def _pack(self, body, content_type, content_encoding, signer, signature,
           sep=str_to_bytes('\x00\x01')):
     fields = sep.join(
         ensure_bytes(s) for s in [signer, signature, content_type,
                                   content_encoding, body]
     )
     return b64encode(fields)
示例#3
0
 def encode_content(self, data):
     content_type, content_encoding, content = self._encode(data)
     if content_encoding == 'binary':
         content = b64encode(content)
     return content_type, content_encoding, content
示例#4
0
文件: database.py 项目: cloudera/hue
 def encode_content(self, data):
     content_type, content_encoding, content = self._encode(data)
     if content_encoding == 'binary':
         content = b64encode(content)
     return content_type, content_encoding, content