Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] vdradmin: make apache 2.0.40 mod_proxy happy



This patch against vdradmin 0.13 makes Apache 2.0.40 mod_proxy happy. I
know this is an old vdradmin version, but 0.23 still exhibits the same
problem.

Apache does not like responses in the form "HTTP/1.1 401", it wants any
text after the number, i.e. "HTTP/1.1 401 Authorization Required".
Otherwise, it an empty line or a line with garbage between the HTTP...
line and the rest of the header lines, thus confusing the browser.

This patch makes vdradmin send some text after the number.

Happy easter,
Tom



-- Attached file included as plaintext by Listar --
-- File: vdradmind.patch

--- vdradmind.pl.cfg	Wed Mar  6 19:26:38 2002
+++ vdradmind.pl	Thu Mar  7 12:32:29 2002
@@ -203,7 +203,7 @@
       filename => "$TEMPLATEDIR/de_index.html",
       die_on_bad_params => 0
     );
-    SendHeader("200", "text/html", $template->output); 
+    SendHeader("200 OK", "text/html", $template->output); 
   } else {
     SendFile($URI);
   }
@@ -354,7 +354,7 @@
   my($template) = HTML::Template->new(
     filename => "$TEMPLATEDIR/$CONFIG{LANG}_error.html");
   $template->param(error => $error);
-  SendHeader("200", "text/html", $template->output);
+  SendHeader("200 OK", "text/html", $template->output);
   return;
 }
 
@@ -411,7 +411,7 @@
   my $template = HTML::Template->new(
     filename => "$TEMPLATEDIR/$CONFIG{LANG}_noauth.html");
   my $Data = $template->output;
-  print($Client "HTTP/1.0 $Status\r\n");
+  print($Client "HTTP/1.0 $Status Authorization Required\r\n");
   print($Client "Date: ", GetHeaderTime(), "\r\n");
   print($Client "Server: $SERVERVERSION\r\n");
   print($Client "WWW-Authenticate: Basic realm=\"Privat\"\r\n");
@@ -449,7 +449,7 @@
       $temp = $File;
       $temp =~ /([A-Za-z0-9]+)\.([A-Za-z0-9]+)/;
       if(!$mimehash{$2}) { die("can't find mime-type \'$2\'\n"); }
-      SendHeader("200", $mimehash{$2}, $buf);
+      SendHeader("200 OK", $mimehash{$2}, $buf);
     } else {
       FileError("403", "Forbidden", "You don't have permission to" .
 	" access /$File on this server.");
@@ -956,7 +956,7 @@
       titel => $titel ? $titel : undef, 
       text  => $text ? $text : undef,
     );
-    SendHeader("200", "text/html", $template->output); 
+    SendHeader("200 OK", "text/html", $template->output); 
   }
 
 
@@ -1048,7 +1048,7 @@
       progname => $progname,
       switchurl  => $MyURL . "?aktion=prog_switch&channel=" . $cnumber
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
   
@@ -1106,7 +1106,7 @@
       naturl => $MyURL . "?aktion=at_timer_new&active=1",
       url    => $MyURL,
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
 
@@ -1152,7 +1152,7 @@
       subtitle=> ($at[$id-1]->{section} & 2) ? 1 : 0,
       description => ($at[$id-1]->{section} & 4) ? 1 : 0,
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
   
   
@@ -1172,7 +1172,7 @@
       prio     => $CONFIG{AT_PRIORITY},
       lft      => $CONFIG{AT_LIFETIME},
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   };
 
 
@@ -1357,7 +1357,7 @@
       vdrid  => $q->param("vdrid") ? $q->param("vdrid") : 0,
       ref    => $q->param("ref") ? $q->param("ref") : undef
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
   
@@ -1597,7 +1597,7 @@
       nowurl => $MyURL . "?aktion=prog_summary",
       url    => $MyURL
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
 
@@ -1662,7 +1662,7 @@
       sortbytime => $MyURL . "?aktion=rec_list&sortby=time",
       sortbyname => $MyURL . "?aktion=rec_list&sortby=name",
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
 
@@ -1693,7 +1693,7 @@
       filename => "$TEMPLATEDIR/de_top.html",
       die_on_bad_params => 0
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
 
@@ -1739,7 +1739,7 @@
       text  => $text ? $text : "",
       titel => $titel
     );
-    SendHeader("200", "text/html", $template->output);	
+    SendHeader("200 OK", "text/html", $template->output);	
   }
 
 
@@ -1860,7 +1860,7 @@
       SELCHANS      => \@selchans,
       url           => $MyURL,
     );
-    SendHeader("200", "text/html", $template->output);
+    SendHeader("200 OK", "text/html", $template->output);
   }
 
   if($q->param("aktion") eq "prog_switch") {


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index