Commit 3fb5c5be authored by Toby Dickenson's avatar Toby Dickenson

Decide whether a body is html by looking at the body we are actually going to...

Decide whether a body is html by looking at the body we are actually going to use, rather than the body we were originally given. We may have given it an html wrapper a few lines earlier.
parent abde85d3
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
############################################################################## ##############################################################################
'''CGI Response Output formatter '''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.56 2002/04/03 20:43:59 shane Exp $''' $Id: HTTPResponse.py,v 1.57 2002/04/05 16:00:17 htrd Exp $'''
__version__='$Revision: 1.56 $'[11:-2] __version__='$Revision: 1.57 $'[11:-2]
import types, os, sys, re import types, os, sys, re
from string import translate, maketrans from string import translate, maketrans
...@@ -264,7 +264,7 @@ class HTTPResponse(BaseResponse): ...@@ -264,7 +264,7 @@ class HTTPResponse(BaseResponse):
if not self.headers.has_key('content-type'): if not self.headers.has_key('content-type'):
isHTML=self.isHTML(body) isHTML=self.isHTML(self.body)
if isHTML: c='text/html' if isHTML: c='text/html'
else: c='text/plain' else: c='text/plain'
self.setHeader('content-type', c) self.setHeader('content-type', c)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment