wsgi plugins: mod_wsgi expects bytes as an output

python3-mod_wsgi expects that the application() method returns
bytes otherwise it breaks.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Stanislav Laznicka
2017-06-27 13:22:00 +02:00
committed by Martin Basti
parent 1a35a2e213
commit db4d0998fd
3 changed files with 8 additions and 6 deletions

View File

@@ -650,7 +650,7 @@ class KerberosSession(HTTP_Status):
headers.append(('IPASESSION', session_cookie))
start_response(HTTP_STATUS_SUCCESS, headers)
return ['']
return [b'']
class KerberosWSGIExecutioner(WSGIExecutioner, KerberosSession):
@@ -1090,7 +1090,7 @@ class change_password(Backend, HTTP_Status):
start_response(status, response_headers)
output = _success_template % dict(title=str(title),
message=str(message))
return [output]
return [output.encode('utf-8')]
class sync_token(Backend, HTTP_Status):
content_type = 'text/plain'
@@ -1188,7 +1188,7 @@ class sync_token(Backend, HTTP_Status):
start_response(status, response_headers)
output = _success_template % dict(title=str(title),
message=str(message))
return [output]
return [output.encode('utf-8')]
class xmlserver_session(xmlserver, KerberosSession):
"""