From 4ad5071b70f25240fa1a4a095859f49f075945bb Mon Sep 17 00:00:00 2001 From: Jon Harper Date: Tue, 16 Feb 2016 14:28:59 +0100 Subject: [PATCH] http.client, fix GETs after POSTs redirects 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/http/client/client.factor b/basis/http/client/client.factor index b1a9daed1f..f5ca7fce3e 100644 --- a/basis/http/client/client.factor +++ b/basis/http/client/client.factor @@ -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