Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
0b6c8223
Commit
0b6c8223
authored
Aug 07, 2013
by
Luca Wehrstedt
Committed by
Denis Bilenko
Sep 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #79: Properly handle HTTP versions
Close #296.
parent
4ff63bf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
gevent/pywsgi.py
gevent/pywsgi.py
+5
-5
No files found.
gevent/pywsgi.py
View file @
0b6c8223
...
...
@@ -29,8 +29,8 @@ _INTERNAL_ERROR_BODY = 'Internal Server Error'
_INTERNAL_ERROR_HEADERS
=
[(
'Content-Type'
,
'text/plain'
),
(
'Connection'
,
'close'
),
(
'Content-Length'
,
str
(
len
(
_INTERNAL_ERROR_BODY
)))]
_REQUEST_TOO_LONG_RESPONSE
=
"HTTP/1.
0
414 Request URI Too Long
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_BAD_REQUEST_RESPONSE
=
"HTTP/1.
0
400 Bad Request
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_REQUEST_TOO_LONG_RESPONSE
=
"HTTP/1.
1
414 Request URI Too Long
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_BAD_REQUEST_RESPONSE
=
"HTTP/1.
1
400 Bad Request
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_CONTINUE_RESPONSE
=
"HTTP/1.1 100 Continue
\
r
\
n
\
r
\
n
"
...
...
@@ -386,7 +386,7 @@ class WSGIHandler(object):
self
.
headers_sent
=
True
self
.
finalize_headers
()
towrite
.
extend
(
'
%s %s
\
r
\
n
'
%
(
self
.
request_version
,
self
.
status
)
)
towrite
.
extend
(
'
HTTP/1.1 %s
\
r
\
n
'
%
self
.
status
)
for
header
in
self
.
response_headers
:
towrite
.
extend
(
'%s: %s
\
r
\
n
'
%
header
)
...
...
@@ -407,7 +407,7 @@ class WSGIHandler(object):
self
.
headers_sent
=
True
self
.
finalize_headers
()
towrite
.
append
(
'
%s %s
\
r
\
n
'
%
(
self
.
request_version
,
self
.
status
)
)
towrite
.
append
(
'
HTTP/1.1 %s
\
r
\
n
'
%
self
.
status
)
for
header
in
self
.
response_headers
:
towrite
.
append
(
'%s: %s
\
r
\
n
'
%
header
)
...
...
@@ -562,7 +562,7 @@ class WSGIHandler(object):
length
=
self
.
headers
.
getheader
(
'content-length'
)
if
length
:
env
[
'CONTENT_LENGTH'
]
=
length
env
[
'SERVER_PROTOCOL'
]
=
'HTTP/1.0'
env
[
'SERVER_PROTOCOL'
]
=
self
.
request_version
client_address
=
self
.
client_address
if
isinstance
(
client_address
,
tuple
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment