net.http: Don't expect the body on redirects

Thu, 10 Dec 2009 22:13:04 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 10 Dec 2009 22:13:04 +0000
changeset 2363
a1e987f499a8
parent 2362
7f5dbf982d14
child 2364
b79e5ba69704

net.http: Don't expect the body on redirects

net/http.lua file | annotate | diff | comparison | revisions
--- a/net/http.lua	Thu Dec 10 18:40:21 2009 +0500
+++ b/net/http.lua	Thu Dec 10 22:13:04 2009 +0000
@@ -30,7 +30,7 @@
 
 local function expectbody(reqt, code)
     if reqt.method == "HEAD" then return nil end
-    if code == 204 or code == 304 then return nil end
+    if code == 204 or code == 304 or code == 301 then return nil end
     if code >= 100 and code < 200 then return nil end
     return 1
 end

mercurial