aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test
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/test
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/test')
-rw-r--r--lib/inets/test/http_format_SUITE.erl2
-rw-r--r--lib/inets/test/httpd_mod.erl7
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl
index 4e10a97f58..9a13ed3d17 100644
--- a/lib/inets/test/http_format_SUITE.erl
+++ b/lib/inets/test/http_format_SUITE.erl
@@ -535,7 +535,7 @@ esi_parse_headers(Config) when is_list(Config) ->
{"location","http://foo.bar.se"}], 302} =
httpd_esi:handle_headers(Headers2),
- {proceed,"/foo/bar.html"} =
+ {ok,[{"location","/foo/bar.html"}], 302} =
httpd_esi:handle_headers("location:/foo/bar.html\r\n").
%%--------------------------------------------------------------------
diff --git a/lib/inets/test/httpd_mod.erl b/lib/inets/test/httpd_mod.erl
index d9118aa1a4..2035b50248 100644
--- a/lib/inets/test/httpd_mod.erl
+++ b/lib/inets/test/httpd_mod.erl
@@ -779,9 +779,14 @@ esi(Type, Port, Host, Node) ->
[{statuscode, 200},
{no_header, "cache-control"},
{version, "HTTP/1.0"}]),
+ ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
+ "GET /cgi-bin/erl/httpd_example:new_status_and_location"
+ " HTTP/1.1\r\n\r\n",
+ [{statuscode, 201},
+ {header, "Location"},
+ {version, "HTTP/1.1"}]),
ok.
-
%%--------------------------------------------------------------------
get(Type, Port, Host, Node) ->
ok = httpd_test_lib:verify_request(Type, Host, Port, Node,