greco: decode/encode suds message (#44354)
This commit is contained in:
parent
78e46ed475
commit
8bfc2dfe2d
|
@ -118,7 +118,7 @@ class Greco(BaseResource):
|
|||
xml.add_header('Content-ID', '<rootpart@entrouvert.org>')
|
||||
# do not base64-encode the soap message
|
||||
xml.replace_header('Content-Transfer-Encoding', '8bit')
|
||||
xml_payload = request.message
|
||||
xml_payload = request.message.decode('utf-8')
|
||||
|
||||
# hack payload to include attachment filenames in
|
||||
# SOAP-ENV:Header.
|
||||
|
@ -164,7 +164,7 @@ class Greco(BaseResource):
|
|||
boundary = message.get_boundary()
|
||||
request.message = message.as_string(unixfrom=False
|
||||
).replace(boundary + '\n', boundary + '\r\n'
|
||||
).replace('\n--' + boundary, '\r\n--' + boundary)
|
||||
).replace('\n--' + boundary, '\r\n--' + boundary).encode('utf-8')
|
||||
request.headers.update(dict(message._headers))
|
||||
request.headers['Authorization'] = self.instance.get_token()
|
||||
resp = self.instance.requests.post(request.url, data=request.message,
|
||||
|
|
Loading…
Reference in New Issue