develooper Front page | perl.libwww | Postings from December 2001

redirect and RFC2068 stuff

Thread Next
From:
Tatsuhiko Miyagawa
Date:
December 4, 2001 09:27
Subject:
redirect and RFC2068 stuff
Message ID:
20011205021955.5487.MIYAGAWA@edge.co.jp
LWP::UserAgent says:

  sub redirect_ok
  {
      # RFC 2068, section 10.3.2 and 10.3.3 say:
      #  If the 30[12] status code is received in response to a request other
      #  than GET or HEAD, the user agent MUST NOT automatically redirect the
      #  request unless it can be confirmed by the user, since this might
      #  change the conditions under which the request was issued.
  
      # Note that this routine used to be just:
      #  return 0 if $_[1]->method eq "POST";  return 1;
  

But many browsers[1] allow redirecting POST request without any
confirmation by users. The point is that the redirected request 
is changed to 'GET', instead of 'POST'.

  Client => Server
    POST /redir.cgi 
  Server => Client
    Location: ./get.cgi
  Client => Server
    GET /get.cgi

If we use request_redirectable with LWP::UA, the last request
stays as 'POST' method, instead of 'GET'.

Is this behaviour considered bug, or feature? If the latter, is
there any nicer way to avoid this?

[1] Experimented with WinNN 4.78, WinIE 5.5, w3m/0.2.1 on FreeBSD.


--
Tatsuhiko Miyagawa <miyagawa@bulknews.net>


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About