W3C home > Mailing lists > Public > www-validator@w3.org > September 1999

Re: /check/referer should redirect

From: Dan Connolly <connolly@w3.org>
Date: Mon, 6 Sep 1999 23:08:09 -0400 (EDT)
Message-ID: <37D481AC.3D37EE3E@w3.org>
To: Brian Gilkison <gilkison@one.net>
CC: www-validator@w3.org
Brian Gilkison wrote:
> Dan,
> The referrer CGI won't work as a bookmark

In its present form, that's true. But it would be a Simple
Matter of Programming to get it to work as expected
(by me, at least).

> -- only works correctly if it
> appears as a link in your "live" documents.  Try changing your bookmark to a
> URL in the format of:
> http://validator.w3.org/check?uri=http://yourservernamehere/yourpathhere/

I want the service to do that for me.

The code is right here:

excerpt from:

my $pair;
foreach $pair (split(/[&;,]/, $parameters)) {

    # this referer handling probably needs fixing to handle strange
    # (possibly tied to the explanation given when connections fail;
    # the referer could be on an intranet, etc.)

    if ( $pair eq "/referer" && $ENV{HTTP_REFERER} =~ m,^http://, ) {
        $FORM{uri} = $ENV{HTTP_REFERER};

In stead of doing a sort of "internal redirect" by
setting $FORM{uri}, it should return a 304 redirect.

The code to do a redirect is already there, too:
redirect_to_home_page . Just adapt that to:

sub redirect_to_check {
    my($checkee) = @_;

    $checkee == &url_quot($checkee); # I assume there's an url_quote
				# routine handy; it's gotta be
				# in LWP, if nowhere else.

    print "Status: 302 Found\n";
    print "Content-Type: text/html\n";
    print "Location: http://validator.w3.org/check?uri=$checkee\n\n";
    print "<title>Found</title>\n";
    print "<p>\n";
    print "  Please see <a
href=\"http://validator.w3.org/check?uri=$checkee\">the results of
checking your page.</a>\n";
    print "</p>\n";



> --
> Dan Connolly, W3C
> http://www.w3.org/People/Connolly/
Received on Monday, 6 September 1999 23:09:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:25 UTC