[Python-checkins] python/dist/src/Lib urllib2.py,1.52,1.53

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 12 Jul 2003 00:33:34 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv30002/Lib

Modified Files:
	urllib2.py 
Log Message:
Patch 549151, rev4: redirect posts for 301 also. Will backport to 2.2.


Index: urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** urllib2.py	10 Jul 2003 13:30:12 -0000	1.52
--- urllib2.py	12 Jul 2003 07:33:32 -0000	1.53
***************
*** 432,438 ****
          m = req.get_method()
          if (code in (301, 302, 303, 307) and m in ("GET", "HEAD")
!             or code in (302, 303) and m == "POST"):
!             # Strictly (according to RFC 2616), 302 in response to a
!             # POST MUST NOT cause a redirection without confirmation
              # from the user (of urllib2, in this case).  In practice,
              # essentially all clients do redirect in this case, so we
--- 432,438 ----
          m = req.get_method()
          if (code in (301, 302, 303, 307) and m in ("GET", "HEAD")
!             or code in (301, 302, 303) and m == "POST"):
!             # Strictly (according to RFC 2616), 301 or 302 in response
!             # to a POST MUST NOT cause a redirection without confirmation
              # from the user (of urllib2, in this case).  In practice,
              # essentially all clients do redirect in this case, so we
***************
*** 481,487 ****
      http_error_301 = http_error_303 = http_error_307 = http_error_302
  
!     inf_msg = "The HTTP server returned a redirect error that would" \
                "lead to an infinite loop.\n" \
!               "The last 302 error message was:\n"
  
  class ProxyHandler(BaseHandler):
--- 481,487 ----
      http_error_301 = http_error_303 = http_error_307 = http_error_302
  
!     inf_msg = "The HTTP server returned a redirect error that would " \
                "lead to an infinite loop.\n" \
!               "The last 30x error message was:\n"
  
  class ProxyHandler(BaseHandler):