Skip to content

Commit 6715922

Browse files
committed
QUERY_STRING may not exist. Closes arskom#612
1 parent 14cdefa commit 6715922

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spyne/server/wsgi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,14 @@ def is_wsdl_request(self, req_env):
312312
return (
313313
req_env['REQUEST_METHOD'].upper() == 'GET'
314314
and (
315-
req_env['QUERY_STRING'].split('=')[0].lower() == 'wsdl'
315+
(
316+
'QUERY_STRING' in req_env
317+
and req_env['QUERY_STRING'].split('=')[0].lower() == 'wsdl'
318+
)
316319
or req_env['PATH_INFO'].endswith('.wsdl')
317320
)
318321
)
319322

320-
321323
def handle_wsdl_request(self, req_env, start_response, url):
322324
ctx = WsgiMethodContext(self, req_env, 'text/xml; charset=utf-8')
323325

0 commit comments

Comments
 (0)