diff options
author | ot <ot@localhost> | 2007-09-27 10:13:36 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2007-09-27 10:13:36 +0000 |
commit | 342ed364617257212f5db4c2a4a5606d09e4a3d0 (patch) | |
tree | 271b335aef6c908c0877201833da8649db9c7d61 | |
parent | 6606c19e48c41c6e48c041973e1d550bc68ac749 (diff) | |
download | markup-validator-342ed364617257212f5db4c2a4a5606d09e4a3d0.zip markup-validator-342ed364617257212f5db4c2a4a5606d09e4a3d0.tar.gz markup-validator-342ed364617257212f5db4c2a4a5606d09e4a3d0.tar.bz2 |
adding experimental parameters to set the Accept and Accept-Language headers
-rwxr-xr-x | htdocs/docs/users.html | 22 | ||||
-rw-r--r-- | htdocs/style/base.css | 2 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 17 |
3 files changed, 36 insertions, 5 deletions
diff --git a/htdocs/docs/users.html b/htdocs/docs/users.html index d2cdd5e..080d3f4 100755 --- a/htdocs/docs/users.html +++ b/htdocs/docs/users.html @@ -1,5 +1,5 @@ -<!--#set var="revision" value="\$Id: users.html,v 1.27 2007-07-09 04:56:26 ot Exp $" ---><!--#set var="date" value="\$Date: 2007-07-09 04:56:26 $" +<!--#set var="revision" value="\$Id: users.html,v 1.28 2007-09-27 10:13:33 ot Exp $" +--><!--#set var="date" value="\$Date: 2007-09-27 10:13:33 $" --><!--#set var="title" value="User Documentation for The W3C Markup Validation Service" --><!--#set var="relroot" value="../" --><!--#include virtual="../header.html" --> @@ -197,6 +197,24 @@ as much help as possible; if you prefer more concise reports, leave this option unset.</p> </dd> + <dt id="option-accept">For Content-Negotiated resources, set a specific <code>Accept</code> Header (<code>accept</code>)</dt> + <dd> + <p>This option (<em>experimental, as of 0.8.2</em>) is useful if your Web server + is set up to use format negotiation, serving different + content based on the preferred/accepted media types of the user-agent. The validator + can then emulate different HTTP <code>Accept</code> behaviors.</p> + <p>For example, append "<code>accept=application%2Fxhtml%2Bxml%2C*</code>" and the validator + will send the HTTP Header "<code>Accept: application/xhtml+xml,*</code>".</p> + </dd> + <dt id="option-accept-language">For Content-Negotiated resources, set a specific <code>Accept-Language</code> Header (<code>accept</code>)</dt> + <dd> + <p>This option (<em>experimental, as of 0.8.2</em>) is useful if your Web server + is set up to use language negotiation, serving content in different languages + based on the preferred/accepted language setup of the user-agent. The validator + can then emulate different HTTP <code>Accept-Language</code> behaviors.</p> + <p>For example, append "<code>accept-language=ja%2Cfr</code>" and the validator + will send the HTTP Header "<code>Accept-Language: ja,fr</code>".</p> + </dd> </dl> <h4 id="Output">Output Options</h4> <p> diff --git a/htdocs/style/base.css b/htdocs/style/base.css index fd61b1c..7fc6052 100644 --- a/htdocs/style/base.css +++ b/htdocs/style/base.css @@ -432,7 +432,7 @@ div.options, p.submit_button, p.instructions, p#note { } p.submit_button { - padding: 0.6em 0 0; + padding: 4.6em 0 0; margin: 0; text-align: center; } diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 41e914b..7775820 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -14,7 +14,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.571 2007-09-25 07:22:03 ot Exp $ +# $Id: check,v 1.572 2007-09-27 10:13:36 ot Exp $ # # Disable buffering on STDOUT! @@ -186,7 +186,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.571 $; + $VERSION = q$Revision: 1.572 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -439,6 +439,9 @@ $File->{Opt}->{'Max Errors'} = $q->param('me') ? $q->param('me') $File->{Opt}->{'Prefill'} = $q->param('prefill') ? TRUE : FALSE; $File->{Opt}->{'Prefill Doctype'} = $q->param('prefill_doctype') ? $q->param('prefill_doctype') : 'html401'; +$File->{Opt}->{'Accept Header'} = $q->param('accept') ? $q->param('accept') : ''; +$File->{Opt}->{'Accept-Language Header'} = $q->param('accept-language') ? $q->param('accept-language') : ''; + # # "Fallback" info for Character Encoding (fbc), Content-Type (fbt), # and DOCTYPE (fbd). If TRUE, the Override values are treated as @@ -1303,6 +1306,16 @@ sub handle_uri { # telling caches in the middle we want a fresh copy (Bug 4998) $req->header(Cache_control=> "max-age=0"); + # if one wants to use the accept and accept-language params + # in order to trigger specific negotiation + if ($File->{Opt}->{'Accept Header'}) { + $req->header(Accept => $File->{Opt}->{'Accept Header'}); + } + if ($File->{Opt}->{'Accept-Language Header'}) { + $req->header(Accept_Language => $File->{Opt}->{'Accept-Language Header'}); + } + + # If we got a Authorization header, the client is back at it after being # prompted for a password so we insert the header as is in the request. if($ENV{HTTP_AUTHORIZATION}){ |