]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: remove invalid http-equiv="content-type"
authorJason Yundt <redacted>
Tue, 8 Mar 2022 15:56:12 +0000 (10:56 -0500)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:33 +0000 (00:51 -0400)
Before this change, gitweb would generate pages which included:

<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>

When a meta's http-equiv equals "content-type", the http-equiv is said
to be in the "Encoding declaration state". According to the HTML
Standard,

The Encoding declaration state may be used in HTML documents,
but elements with an http-equiv attribute in that state must not
be used in XML documents.

Source: <https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-type>

This change removes that meta element since gitweb always generates XML
documents.

Signed-off-by: Jason Yundt <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 8cfa7b8c32346b0c8a49035e6cc5dabc263c26fd88e755580f6d350c24ed6657..ce2c48f8f521531f2c4687fa9ca39f4f7579fc79f80a482e6dbbb6a2e0ac46c3 100755 (executable)
@@ -4214,8 +4214,7 @@ sub git_header_html {
        my %opts = @_;
 
        my $title = get_page_title();
-       my $content_type = get_content_type_html();
-       print $cgi->header(-type=>$content_type, -charset => 'utf-8',
+       print $cgi->header(-type=>get_content_type_html(), -charset => 'utf-8',
                           -status=> $status, -expires => $expires)
                unless ($opts{'-no_http_header'});
        my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : '';
@@ -4226,7 +4225,6 @@ sub git_header_html {
 <!-- git web interface version $version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
 <!-- git core binaries version $git_version -->
 <head>
-<meta http-equiv="content-type" content="$content_type; charset=utf-8"/>
 <meta name="generator" content="gitweb/$version git/$git_version$mod_perl_version"/>
 <meta name="robots" content="index, nofollow"/>
 <title>$title</title>
This page took 0.174372 seconds and 4 git commands to generate.