aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Svensson <[email protected]>2013-01-17 22:53:39 +0100
committerFredrik Gustafsson <[email protected]>2013-01-18 09:58:45 +0100
commit49b7f9ee7dbadb247eee460c418344f61cf6c346 (patch)
tree2dc563ebda31d0f1783e9ef4ad3e7767f6840c97 /lib
parent4b9b5cc645e060fb55e45f88597badf32dd1c985 (diff)
downloadotp-49b7f9ee7dbadb247eee460c418344f61cf6c346.tar.gz
otp-49b7f9ee7dbadb247eee460c418344f61cf6c346.tar.bz2
otp-49b7f9ee7dbadb247eee460c418344f61cf6c346.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/inets/src/http_client/httpc_response.erl5
1 files changed, 5 insertions, 0 deletions
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) ->