]> gitweb.factorcode.org Git - factor.git/commitdiff
http.client, fix GETs after POSTs redirects
authorJon Harper <jon.harper87@gmail.com>
Tue, 16 Feb 2016 13:28:59 +0000 (14:28 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 30 Mar 2016 20:46:55 +0000 (13:46 -0700)
Before this change, after a post is responded to by a 301 redirect,
the next GET had the "content-length: XX" and
"content-type: application/x-www-form-urlencoded" http headers.

Detected by running "http" test while using
squid 3.3.8 which returns a 411 error in this case.

basis/http/client/client.factor

index b1a9daed1f857aad986bd9c7b91db4c98737f47d..f5ca7fce3e997f93e7dd9f435e32798dcb0a3712 100644 (file)
@@ -91,7 +91,7 @@ SYMBOL: redirects
     redirects get request get redirects>> < [
         request get clone
         response "location" header redirect-url
-        response code>> 307 = [ "GET" >>method ] unless
+        response code>> 307 = [ "GET" >>method f >>post-data ] unless
         quot (with-http-request)
     ] [ too-many-redirects ] if ; inline recursive