From 0641827ae6c97bb63697917c54fae777dcc68127 Mon Sep 17 00:00:00 2001 From: Marc Schlatter Date: Wed, 9 Mar 2022 09:53:34 +0100 Subject: [PATCH] Fix string type issues with SOAP/Twisted --- spyne/protocol/soap/soap11.py | 2 +- spyne/server/twisted/http.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spyne/protocol/soap/soap11.py b/spyne/protocol/soap/soap11.py index 75e1add71..e569edfd3 100644 --- a/spyne/protocol/soap/soap11.py +++ b/spyne/protocol/soap/soap11.py @@ -191,7 +191,7 @@ def create_in_document(self, ctx, charset=None): # work with proper POST requests. content_type = ctx.transport.get_request_content_type() http_verb = ctx.transport.get_request_method() - if content_type is None or http_verb != "POST": + if content_type is None or six.ensure_binary(http_verb) != b"POST": ctx.transport.resp_code = HTTP_405 raise RequestNotAllowed( "You must issue a POST request with the Content-Type " diff --git a/spyne/server/twisted/http.py b/spyne/server/twisted/http.py index fda93d152..6d563dc5a 100644 --- a/spyne/server/twisted/http.py +++ b/spyne/server/twisted/http.py @@ -183,7 +183,7 @@ def _reconstruct_url(request): url_scheme = 'http' uri = _decode_path(request.uri) - return ''.join([url_scheme, "://", server_name, uri]) + return ''.join([url_scheme, "://", server_name, uri.decode('utf-8')]) class _Transformer(object):