Skip to content

Commit

Permalink
0.41.0-FIXED - Py3 POST hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Jones committed Apr 21, 2017
1 parent 561c450 commit 2a856fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions zappa/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import base64
import logging
import six
import sys

from requestlogger import ApacheFormatter
Expand All @@ -10,13 +11,10 @@

# The joy of version splintering.
if sys.version_info[0] < 3:
from StringIO import StringIO
from urllib import urlencode
else:
from io import StringIO
from urllib.parse import urlencode


BINARY_METHODS = [
"POST",
"PUT",
Expand Down Expand Up @@ -109,7 +107,7 @@ def create_wsgi_request(event_info,
if 'Content-Type' in headers:
environ['CONTENT_TYPE'] = headers['Content-Type']

environ['wsgi.input'] = StringIO(body)
environ['wsgi.input'] = six.BytesIO(body)
if body:
environ['CONTENT_LENGTH'] = str(len(body))
else:
Expand Down

0 comments on commit 2a856fd

Please sign in to comment.