summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-07-12 07:33:32 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-07-12 07:33:32 (GMT)
commit162f081fb3c3e68e08e477a87311121fd5b72b18 (patch)
tree736a8f5225ce60937579b4d66db95ac48b1df80b /Lib
parenta685f522566edb585db2c9598b8cc36417e9fe95 (diff)
downloadcpython-162f081fb3c3e68e08e477a87311121fd5b72b18.zip
cpython-162f081fb3c3e68e08e477a87311121fd5b72b18.tar.gz
cpython-162f081fb3c3e68e08e477a87311121fd5b72b18.tar.bz2
Patch 549151, rev4: redirect posts for 301 also. Will backport to 2.2.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/urllib2.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index ac556b5..df3729a 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -431,9 +431,9 @@ class HTTPRedirectHandler(BaseHandler):
"""
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
+ 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
# do the same.
@@ -480,9 +480,9 @@ class HTTPRedirectHandler(BaseHandler):
http_error_301 = http_error_303 = http_error_307 = http_error_302
- inf_msg = "The HTTP server returned a redirect error that would" \
+ inf_msg = "The HTTP server returned a redirect error that would " \
"lead to an infinite loop.\n" \
- "The last 302 error message was:\n"
+ "The last 30x error message was:\n"
class ProxyHandler(BaseHandler):
# Proxies must be in front