aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test/http_format_SUITE.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-02-05 13:56:18 +0100
committerErlang/OTP <[email protected]>2014-02-05 13:56:18 +0100
commit5f30912275c02e06de2a03e5b03c64b919c5a048 (patch)
treeb8a716cc5cbf9f68d6a7a6a71cd57d7ff7a4c2d8 /lib/inets/test/http_format_SUITE.erl
parent28eb7e0a25aed6153433ab3e93f023b194d0d858 (diff)
parent6a6653e1fa03d105fa66da54f7291dd592e6f203 (diff)
downloadotp-5f30912275c02e06de2a03e5b03c64b919c5a048.tar.gz
otp-5f30912275c02e06de2a03e5b03c64b919c5a048.tar.bz2
otp-5f30912275c02e06de2a03e5b03c64b919c5a048.zip
Merge branch 'ia/R15B03/inets-5.9.8' into maint-r15
* refs/heads/fetch-and-merge.maint-r15-opu/FETCH_HEAD/11632: (73 commits) Changed to correct errorcode in testcase inets: Prepare for release inets: Make test suites independent of each other inets: Rewrite of test case to avoid timing issues in test code Add missing brackets to report formatting on ftp_progress process exit inets: Remove log message as it causes more harm than use at the moment inets: Mend broken max_clients check inets: Start CT'ify httpd_SUITE inets: Remove use of default gen_server timeout Fix http_request:http_headers/1 to send content-length when length is zero Fix httpd config option 'keep_alive_timeout' Fix httpd config option 'script_timeout' inets: Restore ftp test files for the inets_{,sup_}SUITE to not fail inets: Add crypto start check to ssl test cases ftp: fix sockname dialyzer warning including ftp:sockname/1 bug ftp,ssl: Fixes broken type link (ssloption). ftp: Adds dynamic cert generation to tests. ftp: Clean Makefile and conf file ftp: Linking rfc-refs. ftp: Add documentation. ...
Diffstat (limited to 'lib/inets/test/http_format_SUITE.erl')
-rw-r--r--lib/inets/test/http_format_SUITE.erl24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl
index 04c7358715..c913964094 100644
--- a/lib/inets/test/http_format_SUITE.erl
+++ b/lib/inets/test/http_format_SUITE.erl
@@ -35,14 +35,15 @@
chunk_decode_trailer/1,
http_response/1, http_request/1, validate_request_line/1,
esi_parse_headers/1, cgi_parse_headers/1,
- is_absolut_uri/1, convert_netscapecookie_date/1]).
+ is_absolut_uri/1, convert_netscapecookie_date/1,
+ check_content_length_encoding/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[{group, chunk}, http_response, http_request,
validate_request_line, {group, script}, is_absolut_uri,
- convert_netscapecookie_date].
+ convert_netscapecookie_date, check_content_length_encoding].
groups() ->
[{script, [], [esi_parse_headers, cgi_parse_headers]},
@@ -456,6 +457,25 @@ validate_request_line(Config) when is_list(Config) ->
httpd_request:validate("GET", NewForbiddenUri1, "HTTP/1.1"),
ok.
+
+%%-------------------------------------------------------------------------
+check_content_length_encoding(doc) ->
+ ["Test http_request:headers/2. Check that the content-length is"
+ " encoded even when it is zero." ];
+check_content_length_encoding(suite) ->
+ [];
+check_content_length_encoding(Config) when is_list(Config) ->
+
+ %% Check that the content-length is preserved.
+ %% Sanity check.
+ Header1 = http_request:http_headers(#http_request_h{'content-length'="123"}),
+ true = (string:str(Header1, "content-length: 123\r\n") > 0),
+ %% Check that content-length=0 is handled correctly.
+ Header2 = http_request:http_headers(#http_request_h{'content-length'="0"}),
+ true = (string:str(Header2, "content-length: 0\r\n") > 0),
+
+ ok.
+
%%-------------------------------------------------------------------------
esi_parse_headers(doc) ->
["Test httpd_esi:*. All header values are received in the same"