diff options
Diffstat (limited to 'rt/share/html/NoAuth/css/dhandler')
-rw-r--r-- | rt/share/html/NoAuth/css/dhandler | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/rt/share/html/NoAuth/css/dhandler b/rt/share/html/NoAuth/css/dhandler index 2472a9ff7..8e887b9a2 100644 --- a/rt/share/html/NoAuth/css/dhandler +++ b/rt/share/html/NoAuth/css/dhandler @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -50,28 +50,15 @@ my $squisher; </%ONCE> <%INIT> my $arg = $m->dhandler_arg; -my $path; -if ( $arg =~ m{^(.*)-squished(\.[^\.]+)$} ) { - $path = $m->current_comp->dir_path .'/'. $1 . $2; +if ( $arg =~ m{(.*)-squished-[0-9a-f]{32}\.css$} ) { + my $style = $1; + my $squished = RT::Interface::Web::SquishedCSS( $style ); + # Don't send Last-Modified since we don't handle If-Modified-Since + #$r->header_out( 'Last-Modified' => $squished->ModifiedTimeString ); + $m->out( $squished->Content ); } else { return $m->decline; } -$squisher = new RT::CSS::Squish unless $squisher; -$squisher->{'mason'} = $m; - -$m->out( $squisher->concatenate( $path ) ); - -package RT::CSS::Squish; -use CSS::Squish '0.06'; -use base qw(CSS::Squish); -sub file_handle { - my $self = shift; - my $file = shift; - my $content = $self->{'mason'}->scomp($file) || ''; - open( my $fh, '<', \$content ) or die "$!"; - return $fh; -} - </%INIT> |