Diff for /loncom/cgi/loncgi.pm between versions 1.11 and 1.12

version 1.11, 2008/12/25 01:51:03 version 1.12, 2011/10/21 20:00:30
Line 54  use warnings FATAL=>'all'; Line 54  use warnings FATAL=>'all';
 no warnings 'uninitialized';  no warnings 'uninitialized';
   
 use lib '/home/httpd/lib/perl/';  use lib '/home/httpd/lib/perl/';
 use CGI();  use CGI qw(:standard);
 use CGI::Cookie();  use CGI::Cookie();
   use MIME::Types();
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use LONCAPA;  use LONCAPA;
 use LONCAPA::Configuration();  use LONCAPA::Configuration();
Line 222  sub cgi_getitems { Line 223  sub cgi_getitems {
     }      }
     return;      return;
 }  }
   
   #############################################
   #############################################
   
   =pod
   
   =cgi_header()
   
   Inputs: $contenttype - Content Type (e.g., text/html or text/plain)
           $nocache     - Boolean 1 = nocache
   Returns: HTTP Response headers constructed using CGI.pm
   
   =cut
   
   #############################################
   #############################################
   sub cgi_header {
       my ($contenttype,$nocache) = @_;
       my $mimetypes = MIME::Types->new;
       my %headers;
       if ($contenttype ne '') {
           if ($mimetypes->type($contenttype) ne '') {
               $headers{'-type'} = $contenttype;
           }
       }
       if ($nocache) {
          $headers{'-expires'} = 'now';
       }
       if (%headers) {
           return CGI::header(%headers);
       }
       return;
   }
   
 =pod  =pod
   

Removed from v.1.11  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>