summaryrefslogtreecommitdiff
path: root/paste/debug
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-03-26 02:58:57 +0000
committerianb <devnull@localhost>2008-03-26 02:58:57 +0000
commitb5d733c23100508b50fe89a80a23d947903efa8f (patch)
treef89587fcd4df4980397b3c8986d3b70201e77969 /paste/debug
parentb0d7f9375fcce4f514fb41eab767ccb1d6b93f03 (diff)
downloadpaste-b5d733c23100508b50fe89a80a23d947903efa8f.tar.gz
Keep paste.debug.profile from breaking when there is no Content-Type, from Kumar McMillan (#233)
Diffstat (limited to 'paste/debug')
-rw-r--r--paste/debug/profile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/debug/profile.py b/paste/debug/profile.py
index fcf943c..8e2d40a 100644
--- a/paste/debug/profile.py
+++ b/paste/debug/profile.py
@@ -32,7 +32,7 @@ class ProfileMiddleware(object):
only usable in development environments.
"""
- style = ('background-color: #ff9; color: #000; '
+ style = ('clear: both; background-color: #ff9; color: #000; '
'border: 2px solid #000; padding: 5px;')
def __init__(self, app, global_conf=None,
@@ -68,7 +68,7 @@ class ProfileMiddleware(object):
body = ''.join(body)
headers = catch_response[1]
content_type = response.header_value(headers, 'content-type')
- if not content_type.startswith('text/html'):
+ if content_type is None or not content_type.startswith('text/html'):
# We can't add info to non-HTML output
return [body]
stats = hotshot.stats.load(self.log_filename)