gitweb: check if HTTP_ACCEPT is really set
Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Lederhofer committed
Aug 6, 2006 at 15:55 UTC
bd943f4757ab1d62d862ea12b4cf8b6b495e115f
1 file changed
+1
-1
gitweb/gitweb.perl
+1
-1
@@ -856,7 +856,7 @@ sub git_header_html {
856
# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.
857
# we have to do this because MSIE sometimes globs '*/*', pretending to
858
# support xhtml+xml but choking when it gets what it asked for.
859
- if ($cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) {
859
+ if (defined $cgi->http('HTTP_ACCEPT') && $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) {
860
$content_type = 'application/xhtml+xml';
861
} else {
862
$content_type = 'text/html';