]> ruin.nu Git - ndwebbie.git/commitdiff
minor changes
authorMichael Andreen <harv@ruin.nu>
Sun, 21 Jan 2007 14:45:26 +0000 (14:45 +0000)
committerMichael Andreen <harv@ruin.nu>
Sun, 21 Jan 2007 14:45:26 +0000 (14:45 +0000)
ND.pm
ND/Web/XMLPage.pm
apache-conf.conf

diff --git a/ND.pm b/ND.pm
index 757108b7a76b0b42c17339192c15a4f7c1693748..791d5f096c2170532684a9348408c689630f9e71 100755 (executable)
--- 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};
index 68fd96b246b078f333d9dcd770fc4a432a0c26df..ccdb7c511a07897dbf5777ba78b2ecc8da6475a2 100644 (file)
@@ -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);
index ba4d9275fca771dc65e3ee08506edd662609e06a..9a2bdaf03162b9d8d7d137e9dda8f8b2a386a046 100644 (file)
     #
     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.
     #