From: Ævar Arnfjörð Bjarmason Date: Tue, 08 Mar 2022 12:44:35 GMT Subject: Re: [PATCH v2 2/2] gitweb: remove invalid http-equiv="content-type" Message-ID: <220308.86cziwy595.gmgdl@evledraar.gmail.com> In-Reply-To: On Tue, Mar 08 2022, brian m. carlson wrote: > [[PGP Signed Part:Undecided]] > On 2022-03-08 at 01:07:11, Jason Yundt wrote: >> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl >> index fbd1c20a23..59457c1004 100755 >> --- a/gitweb/gitweb.perl >> +++ b/gitweb/gitweb.perl >> @@ -4225,7 +4225,7 @@ sub git_header_html { >> >> >> >> - >> + > > I don't actually think this is an improvement. I don't think it's > necessary, considering we have an XML declaration and the HTTP header, > both of which already say it's UTF-8 and will take precedence over this. Ageed. I was a bit surprised per Jason's https://lore.kernel.org/git/109813056.nniJfEyVGO@jason-desktop-linux/ that the removal wasn't kept. I.e. he was replying to a question of mine asking whether we didn't need this data at rest, e.g if you save the page. I didn't notice the "http('HTTP_ACCEPT') && $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) { - return 'application/xhtml+xml'; + return get_content_type_html(); } else { return 'text/html'; } @@ -4214,6 +4220,7 @@ sub git_header_html { my $title = get_page_title(); my $content_type = get_content_type_html(); + my $content_type_xml = get_content_type_html(); print $cgi->header(-type=>$content_type, -charset => 'utf-8', -status=> $status, -expires => $expires) unless ($opts{'-no_http_header'}); @@ -4225,7 +4232,7 @@ sub git_header_html { - + $title Of course we might then *also* decide that in this case isn't needed at all, but isn't that a seperate change? And won't conforming browsers treat application/xhtml+xml differently when the page is saved? A long time ago (Idid some web development) using it would enable pedantic strictness in browsers, i.e. unclosed tags etc. would be a hard error, but I can't reproduce that locally in either Firefox or Chrome now (with just the gitweb output as-is with that http-equiv tweaked). So maybe it does nothing, or maybe it's just those browser...