aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd_example.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-10-24 17:55:24 +0200
committerIngela Anderton Andin <[email protected]>2017-11-01 10:53:17 +0100
commit2cc5ba70cbbc6b3ace81a2a0324417c3b65265bb (patch)
treeb8fc8b1e746933fc89f838f32c31b8c8d39a2801 /lib/inets/src/http_server/httpd_example.erl
parenta98379d0519c28f9bc9b673ed2c09fb1ad52456e (diff)
downloadotp-2cc5ba70cbbc6b3ace81a2a0324417c3b65265bb.tar.gz
otp-2cc5ba70cbbc6b3ace81a2a0324417c3b65265bb.tar.bz2
otp-2cc5ba70cbbc6b3ace81a2a0324417c3b65265bb.zip
inets: httpd - do not hardcode 302 status for location
If a status code is provide by the ESI script that status code should have precedence over internal defaults. Also remove RFC 2616 requirement that URI must be absolute, that requirement is relaxed by RFC 7231.
Diffstat (limited to 'lib/inets/src/http_server/httpd_example.erl')
-rw-r--r--lib/inets/src/http_server/httpd_example.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_example.erl b/lib/inets/src/http_server/httpd_example.erl
index 45b6deba97..adbbf64685 100644
--- a/lib/inets/src/http_server/httpd_example.erl
+++ b/lib/inets/src/http_server/httpd_example.erl
@@ -20,7 +20,7 @@
%%
-module(httpd_example).
-export([print/1]).
--export([get/2, put/2, post/2, yahoo/2, test1/2, get_bin/2, peer/2]).
+-export([get/2, put/2, post/2, yahoo/2, test1/2, get_bin/2, peer/2,new_status_and_location/2]).
-export([newformat/3, post_chunked/3]).
%% These are used by the inets test-suite
@@ -90,6 +90,9 @@ post(Env,Input) ->
yahoo(_Env,_Input) ->
"Location: http://www.yahoo.com\r\n\r\n".
+new_status_and_location(_Env,_Input) ->
+ "status:201\r\n Location: http://www.yahoo.com\r\n\r\n".
+
default(Env,Input) ->
[header(),
top("Default Example"),