From 49b7f9ee7dbadb247eee460c418344f61cf6c346 Mon Sep 17 00:00:00 2001 From: Hans Svensson Date: Thu, 17 Jan 2013 22:53:39 +0100 Subject: inets: fix autoredirect for POST requests responding 303 Changed httpc_response, for redirect '303 See Other' also POST requests should be redirected (using GET). See RFC2616 sect. 10.3.4 for clarification. --- lib/inets/src/http_client/httpc_response.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/inets/src') diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl index 04976447cc..37f5f2ce6d 100644 --- a/lib/inets/src/http_client/httpc_response.erl +++ b/lib/inets/src/http_client/httpc_response.erl @@ -124,6 +124,11 @@ result(Response = {{_, Code, _}, _, _}, (Code =:= 303) orelse (Code =:= 307) -> redirect(Response, Request); +result(Response = {{_, 303, _}, _, _}, + Request = #request{settings = + #http_options{autoredirect = true}, + method = post}) -> + redirect(Response, Request#request{method = get}); result(Response = {{_,503,_}, _, _}, Request) -> -- cgit v1.2.3