diff --git a/VERSION b/VERSION index e88b45a9..8009008d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.1 (2012-08-29 07:27:23) rc4 +Version 2.00.1 (2012-08-29 08:22:30) rc4 diff --git a/gluon/http.py b/gluon/http.py index 548ac6d9..5963603a 100644 --- a/gluon/http.py +++ b/gluon/http.py @@ -76,7 +76,7 @@ class HTTP(BaseException): self.headers['Set-Cookie'] = [ str(cookie)[11:] for cookie in cookies.values()] - def to(self, responder): + def to(self, responder, env={}): status = self.status headers = self.headers if status in defined_status: @@ -100,7 +100,9 @@ class HTTP(BaseException): else: rheaders.append((k, str(v))) responder(status, rheaders) - if isinstance(body,str): + if env.get('request_method','')=='HEAD': + return [''] + elif isinstance(body,str): return [body] elif hasattr(body, '__iter__'): return body diff --git a/gluon/main.py b/gluon/main.py index efa30df7..d5e6d25c 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -526,7 +526,8 @@ def wsgibase(environ, responder): except HTTP, http_response: if static_file: - return http_response.to(responder) + return http_response.to(responder,env=env) + if request.body: request.body.close() @@ -636,7 +637,7 @@ def wsgibase(environ, responder): return wsgibase(new_environ,responder) if global_settings.web2py_crontype == 'soft': newcron.softcron(global_settings.applications_parent).start() - return http_response.to(responder) + return http_response.to(responder,env=env) def save_password(password, port):