Commits

Anonymous committed 13485c8

exceptions respect HEAD now

Comments (0)

Files changed (1)

werkzeug/exceptions.py

 
     def __call__(self, environ, start_response):
         status = '%d %s' % (self.code, self.name)
-        headers = self.get_headers(environ)
-        start_response(status, headers)
-        yield self.get_body(environ)
+        start_response(status, self.get_headers(environ))
+        if environ['REQUEST_METHOD'] == 'HEAD':
+            return ()
+        return [self.get_body(environ)]
 
 
 class BadRequest(HTTPException):