aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-11-07 10:25:16 +0100
committerIngela Anderton Andin <[email protected]>2017-11-09 09:56:15 +0100
commit4dcabdcc5ab7f41189ec3937e84b323d80d6df57 (patch)
tree0d1b43faac84e28f2cabf4a1dbe020b84087cf72 /lib/inets/src
parent3e8c1ff94c0a73df71daadd4eb782c21c49f22d9 (diff)
downloadotp-4dcabdcc5ab7f41189ec3937e84b323d80d6df57.tar.gz
otp-4dcabdcc5ab7f41189ec3937e84b323d80d6df57.tar.bz2
otp-4dcabdcc5ab7f41189ec3937e84b323d80d6df57.zip
inets: Add missing guard
Add test in the correct place which was the reason the guard became missing without being noticed.
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_server/httpd_esi.erl2
-rw-r--r--lib/inets/src/http_server/httpd_example.erl2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_esi.erl b/lib/inets/src/http_server/httpd_esi.erl
index fd50934d00..f5493f6fad 100644
--- a/lib/inets/src/http_server/httpd_esi.erl
+++ b/lib/inets/src/http_server/httpd_esi.erl
@@ -86,7 +86,7 @@ handle_headers([], NewHeaders, StatusCode, _) ->
handle_headers([Header | Headers], NewHeaders, StatusCode, NoESIStatus) ->
{FieldName, FieldValue} = httpd_response:split_header(Header, []),
case FieldName of
- "location" ->
+ "location" when NoESIStatus == true ->
handle_headers(Headers,
[{FieldName, FieldValue} | NewHeaders],
302, NoESIStatus);
diff --git a/lib/inets/src/http_server/httpd_example.erl b/lib/inets/src/http_server/httpd_example.erl
index adbbf64685..47a8c48d01 100644
--- a/lib/inets/src/http_server/httpd_example.erl
+++ b/lib/inets/src/http_server/httpd_example.erl
@@ -91,7 +91,7 @@ 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".
+ "status:201 Created\r\n Location: http://www.yahoo.com\r\n\r\n".
default(Env,Input) ->
[header(),