mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix content length
This commit is contained in:
parent
d9a2579613
commit
4a519f9d61
@ -83,6 +83,7 @@ class Request(object):
|
|||||||
server_address = self.server_address
|
server_address = self.server_address
|
||||||
script_name = os.environ.get("SCRIPT_NAME", "")
|
script_name = os.environ.get("SCRIPT_NAME", "")
|
||||||
content_type = ""
|
content_type = ""
|
||||||
|
content_length = ""
|
||||||
for hdr_name, hdr_value in req.headers:
|
for hdr_name, hdr_value in req.headers:
|
||||||
name = hdr_name.lower()
|
name = hdr_name.lower()
|
||||||
if name == "expect":
|
if name == "expect":
|
||||||
@ -97,14 +98,12 @@ class Request(object):
|
|||||||
script_name = hdr_value
|
script_name = hdr_value
|
||||||
elif name == "content-type":
|
elif name == "content-type":
|
||||||
content_type = hdr_value
|
content_type = hdr_value
|
||||||
|
elif name == "content-length":
|
||||||
|
content_length = hdr_value
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
wsgi_input = req.body
|
|
||||||
if hasattr(req.body, "length"):
|
|
||||||
content_length = str(req.body.length)
|
|
||||||
else:
|
|
||||||
content_length = None
|
|
||||||
|
|
||||||
# This value should evaluate true if an equivalent application
|
# This value should evaluate true if an equivalent application
|
||||||
# object may be simultaneously invoked by another process, and
|
# object may be simultaneously invoked by another process, and
|
||||||
# should evaluate false otherwise. In debug mode we fall to one
|
# should evaluate false otherwise. In debug mode we fall to one
|
||||||
@ -134,7 +133,7 @@ class Request(object):
|
|||||||
|
|
||||||
environ = {
|
environ = {
|
||||||
"wsgi.url_scheme": url_scheme,
|
"wsgi.url_scheme": url_scheme,
|
||||||
"wsgi.input": wsgi_input,
|
"wsgi.input": req.body,
|
||||||
"wsgi.errors": sys.stderr,
|
"wsgi.errors": sys.stderr,
|
||||||
"wsgi.version": (1, 0),
|
"wsgi.version": (1, 0),
|
||||||
"wsgi.multithread": False,
|
"wsgi.multithread": False,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user