Skip to main content.
home | support | download

Back to List Archive

Re: 302 redirects and 'Wrong method or server' error

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Aug 01 2005 - 05:57:08 GMT
On Sun, Jul 31, 2005 at 07:47:38PM -0700, Francis Vierboom wrote:
> The problem seems to be that the 302 response only contains the relative 
> URI. A correctly formed 302 response has an absolute URI - ie it should be
> 
> 302. http://www.site.com/Default.asp?c=1298
> instead of just
> 302. /Default.asp?c=1298

That's lame.

> Can anyone confirm that swish-e does in fact have this problem, and if 
> so, maybe swish-e should consider honouring these sloppy redirects?

Maybe you need to updated your Perl modules?

Here's a broken redirect:

    moseley@bumby:~/apache$ cat test.cgi
    #!/usr/bin/perl
    print "Status: 302 Moved\nLocation: /apache/index.html\n\n";

Here's the file it redirects to:

    moseley@bumby:~/apache$ cat index.html
    <html>
    <head><title>index.html</title>
    </head>
    <body>
    This is index.html
    </body>
    </html>

Here's LWP's GET method following the redirect:

    moseley(at)not-real.bumby:~/apache$ GET -S http://localhost/apache/test.cgi
    GET http://localhost/apache/test.cgi --> 302 Moved
    GET http://localhost/apache/index.html --> 200 OK
    <html>
    <head><title>index.html</title>
    </head>
    <body>
    This is index.html
    </body>
    </html>

The spider uses LWP, so also follows the link:

    moseley(at)not-real.bumby:~/apache$ /usr/local/lib/swish-e/spider.pl default http://localhost/apache/test.cgi
    /usr/local/lib/swish-e/spider.pl: Reading parameters from 'default'
    Path-Name: http://localhost/apache/index.html
    Content-Length: 89
    Last-Mtime: 1122875111
    Document-Type: html*

    <html>
    <head><title>index.html</title>
    </head>
    <body>
    This is index.html
    </body>
    </html>



-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Sun Jul 31 22:57:17 2005