[Jifty-commit] jifty branch, master, updated. 1b150d0ee5dad6d308615566b1efbb65b9688921
Jifty commits
jifty-commit at lists.jifty.org
Tue Mar 30 00:58:23 EDT 2010
The branch, master has been updated
via 1b150d0ee5dad6d308615566b1efbb65b9688921 (commit)
via 2741543f0c0049ca412bdc294903fb7df7674014 (commit)
from 476a2e53f08a3e29198e14960f39c41fc3a08364 (commit)
Summary of changes:
lib/Jifty/CAS.pm | 5 +++--
lib/Jifty/View/Static/Handler.pm | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 2741543f0c0049ca412bdc294903fb7df7674014
Author: Chia-liang Kao <clkao at clkao.org>
Date: Tue Mar 30 12:50:22 2010 +0800
Fix a regression that Content-Length was no longer sent for static content.
diff --git a/lib/Jifty/View/Static/Handler.pm b/lib/Jifty/View/Static/Handler.pm
index 9198410..9b2fc43 100644
--- a/lib/Jifty/View/Static/Handler.pm
+++ b/lib/Jifty/View/Static/Handler.pm
@@ -234,6 +234,7 @@ sub send_http_header {
# Expire in a year
$response->header( 'Cache-Control' => 'max-age=31536000, public' );
$response->header( 'Expires' => HTTP::Date::time2str( $now + 31536000 ) );
+ $response->header( 'Content-Length' => $length ) if $length;
$response->header(
'Last-Modified' => HTTP::Date::time2str( $modified ) ) if $modified;
commit 1b150d0ee5dad6d308615566b1efbb65b9688921
Author: Chia-liang Kao <clkao at clkao.org>
Date: Tue Mar 30 12:50:58 2010 +0800
Fix CAS content http If-Modified-Since behaviour, and send along last-modified header.
diff --git a/lib/Jifty/CAS.pm b/lib/Jifty/CAS.pm
index 8ff985c..e41c6da 100644
--- a/lib/Jifty/CAS.pm
+++ b/lib/Jifty/CAS.pm
@@ -80,7 +80,7 @@ sub serve_by_name {
return $class->_serve_404( $domain, $name, "Unable to lookup key." )
if not defined $key;
- if ( Jifty->web->request->env->{'If-Modified-Since'} and $incoming_key eq $key ) {
+ if ( Jifty->web->request->header('If-Modified-Since') and $incoming_key eq $key ) {
Jifty->log->debug("Returning 304 for CAS cached $domain:$name ($key)");
Jifty->web->response->header( Status => 304 );
return 304;
@@ -92,7 +92,8 @@ sub serve_by_name {
if not defined $obj;
Jifty->web->response->content_type($obj->metadata->{content_type});
- Jifty::View::Static::Handler->send_http_header('', length($obj->content));
+ Jifty::View::Static::Handler->send_http_header('', length($obj->content),
+ $obj->metadata->{time});
Jifty->log->debug("Sending squished $domain:$name ($key) from CAS");
Jifty->web->out($obj->content);
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list