def generate_response(self, environ, start_response):
        if self.content_length is not None:
            del self.content_length
        headerlist = list(self.headerlist)
        accept = environ.get('HTTP_ACCEPT', '')
        if accept and 'html' in accept or '*/*' in accept:
            body = self.html_body(environ)
            if not self.content_type:
                headerlist.append('text/html; charset=utf8')
        else:
            body = self.plain_body(environ)
            if not self.content_type:
                headerlist.append('text/plain; charset=utf8')
        headerlist.append(('Content-Length', str(len(body))))
        start_response(self.status, headerlist)
        return [body]
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webob_0_9/webob/exc.py/WSGIHTTPException.generate_response/original