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
104e7014
Commit
104e7014
authored
Apr 08, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pywsgi: do not send a stacktrace to the client
parent
bc85dc14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
gevent/pywsgi.py
gevent/pywsgi.py
+13
-11
No files found.
gevent/pywsgi.py
View file @
104e7014
...
...
@@ -44,6 +44,16 @@ _monthname = [None, # Dummy so we can use 1-based month numbers
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
]
_INTERNAL_ERROR_STATUS
=
'500 Internal Server Error'
INTERNAL_ERROR_RESPONSE
=
"""HTTP/1.0 %s
Connection: close
Content-type: text/plain
Content-length: 21
Internal Server Error"""
.
replace
(
'
\
n
'
,
'
\
r
\
n
'
)
%
_INTERNAL_ERROR_STATUS
def
format_date_time
(
timestamp
):
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
y
,
z
=
time
.
gmtime
(
timestamp
)
return
"%s, %02d %3s %4d %02d:%02d:%02d GMT"
%
(
...
...
@@ -244,19 +254,11 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
if
not
self
.
headers_sent
or
self
.
response_use_chunked
:
self
.
write
(
''
)
except
Exception
:
self
.
status
=
'500 Internal Server Error'
self
.
status
=
_INTERNAL_ERROR_STATUS
self
.
close_connection
=
1
exc
=
traceback
.
format_exc
()
print
exc
traceback
.
print_exc
()
if
not
self
.
response_length
:
self
.
wfile
.
writelines
(
[
"HTTP/1.0 500 Internal Server Error
\
r
\
n
"
,
"Connection: close
\
r
\
n
"
,
"Content-type: text/plain
\
r
\
n
"
,
"Content-length: %s
\
r
\
n
"
%
len
(
exc
),
"
\
r
\
n
"
,
exc
])
self
.
wfile
.
write
(
INTERNAL_ERROR_RESPONSE
)
finally
:
if
hasattr
(
result
,
'close'
):
result
.
close
()
...
...
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