Index: httpd/cgi-bin/check =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/check,v retrieving revision 1.588 diff -U 3 -r1.588 check --- httpd/cgi-bin/check 5 May 2008 03:30:18 -0000 1.588 +++ httpd/cgi-bin/check 14 Jun 2008 19:23:47 -0000 @@ -1119,6 +1119,15 @@ if ($File->{'Error Flagged'}) { $T->param(fatal_error => TRUE); } + + # + # Allow content-negotiation + if ($File->{Opt}->{'Accept Header'}) { + $T->param('accept' => $File->{Opt}->{'Accept Header'}); + } + if ($File->{Opt}->{'Accept-Language Header'}) { + $T->param('accept-language' => $File->{Opt}->{'Accept-Language Header'}); + } } sub fin_template ($$) { @@ -2071,9 +2080,11 @@ # Avoid CGI.pm's "exists but undef" behaviour. if (scalar $q->param) { foreach my $param ($q->param) { - next if $param eq 'uploaded_file'; # 'uploaded_file' contains data. - next if $param eq 'fragment'; # Ditto 'fragment'. - next if $q->param($param) eq '0'; # Keep false-but-set params. + next if $param eq 'uploaded_file'; # 'uploaded_file' contains data. + next if $param eq 'fragment'; # Ditto 'fragment'. + next if $param eq 'accept'; # Ditto. + next if $param eq 'accept-language'; # Ditto. + next if $q->param($param) eq '0'; # Keep false-but-set params. # # Parameters that are given to us without specifying a value get @@ -2128,6 +2139,10 @@ if ($q->param('uri') and $q->param('uri') eq 'referer') { if ($q->referer) { $q->param('uri', $q->referer); + $q->param('accept',$q->http('Accept')) + if ($q->http('Accept')); + $q->param('accept-language',$q->http('Accept-Language')) + if ($q->http('Accept-Language')); print redirect &self_url_q($q, $File); exit; } else { @@ -2515,6 +2530,10 @@ $thispage .= 'No200=1;' if $q->param('No200'); $thispage .= 'verbose=1;' if $q->param('verbose'); $thispage .= 'group=1;' if $q->param('group'); + $thispage .= 'accept=' . uri_escape($q->param('accept')) . ';' + if $q->param('accept'); + $thispage .= 'accept-language='. uri_escape($q->param('accept-language')) .';' + if $q->param('accept-language'); if ($q->param('doctype') and not $q->param('doctype') =~ /(Inline|detect)/i) { @@ -2551,6 +2570,12 @@ $thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'}; $thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'}; $thispage .= ';outline=1' if $File->{Opt}->{'Outline'}; + $thispage .= 'accept=' . + uri_escape($File->{Opt}->{'Accept Header'}) . ';' + if $File->{Opt}->{'Accept Header'}; + $thispage .= 'accept-language=' . + uri_escape($File->{Opt}->{'Accept-Language Header'}) .';' + if $File->{Opt}->{'Accept-Language Header'}; # These were not added by report_valid; perhaps they should be? # $thispage .= ';verbose=1' if $File->{Opt}->{'Verbose'}; Index: share/templates/en_US/table.tmpl =================================================================== RCS file: /sources/public/validator/share/templates/en_US/table.tmpl,v retrieving revision 1.39 diff -U 3 -r1.39 table.tmpl --- share/templates/en_US/table.tmpl 5 May 2008 03:29:30 -0000 1.39 +++ share/templates/en_US/table.tmpl 14 Jun 2008 19:23:47 -0000 @@ -160,7 +160,15 @@
Help on the options is available.
- +