Skip to content

Commit

Permalink
switch order of argument fetching around
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed Apr 11, 2014
1 parent 7ef134d commit 114bd60
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vumi/transports/mxit/mxit.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ def get_request_data(self, request):
return data

def get_request_content(self, request):
headers = request.requestHeaders
[content] = headers.getRawHeaders('X-Mxit-User-Input', [None])
if content:
return unquote_plus(content)

if request.args and 'input' in request.args:
[content] = request.args['input']
else:
headers = request.requestHeaders
[content] = headers.getRawHeaders('X-Mxit-User-Input', [None])
return (None if content is None else unquote_plus(content))
return content

return None

def handle_raw_inbound_message(self, msg_id, request):
if not self.is_mxit_request(request):
Expand Down

0 comments on commit 114bd60

Please sign in to comment.