From: Michael Andreen Date: Sun, 21 Jan 2007 14:45:26 +0000 (+0000) Subject: minor changes X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=7fec381e300732e503286056289eb91dec6d7dcd minor changes --- diff --git a/ND.pm b/ND.pm index 757108b..791d5f0 100755 --- a/ND.pm +++ b/ND.pm @@ -43,7 +43,7 @@ sub handler { if ($ENV{'SCRIPT_NAME'} =~ /(\w+)(\.(pl|php|pm))?$/){ $page = $1 unless $1 eq 'index' and $3 eq 'pl'; } - $page = ND::Web::Page->new(PAGE => $page, DBH => $ND::DBH, URI => $ENV{REQUEST_URI}, USER_AGENT => $ENV{HTTP_USER_AGENT}); + $page = ND::Web::Page->new(PAGE => $page, DBH => $ND::DBH, URI => $ENV{REQUEST_URI}, USER_AGENT => $ENV{HTTP_USER_AGENT}, HTTP_ACCEPT => $ENV{HTTP_ACCEPT}); $page->render; $ND::DBH->rollback unless $ND::DBH->{AutoCommit}; diff --git a/ND/Web/XMLPage.pm b/ND/Web/XMLPage.pm index 68fd96b..ccdb7c5 100644 --- a/ND/Web/XMLPage.pm +++ b/ND/Web/XMLPage.pm @@ -79,8 +79,10 @@ sub render : method { $self->process; - my $type = 'application/xhtml+xml'; - $type = 'text/html' if $self->{USER_AGENT} =~ /MSIE/; + my $type = 'text/html'; + if ($self->{HTTP_ACCEPT} =~ m{application/xhtml\+xml}){ + $type = 'application/xhtml+xml' + } my $body; if ($self->{XML}){ $type = 'text/xml'; @@ -119,7 +121,6 @@ sub render : method { my ($css) = $DBH->selectrow_array(q{SELECT css FROM users WHERE uid = $1},undef,$ND::UID); $template->param(CSS => $css); $template->param(TITLE => $self->{TITLE}); - } $template->param(Error => $ND::ERROR); $template->param(BODY => $body->output); diff --git a/apache-conf.conf b/apache-conf.conf index ba4d927..9a2bdaf 100644 --- a/apache-conf.conf +++ b/apache-conf.conf @@ -69,6 +69,12 @@ # DocumentRoot "/var/www/ndawn/htdocs" + DeflateFilterNote ratio + AddOutputFilterByType DEFLATE text/* + AddOutputFilterByType DEFLATE application/xhtml+xml + AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript + + # # This should be changed to whatever you set DocumentRoot to. #