From e2b0e1828957e53063a2fa8f39188017a44a2c32 Mon Sep 17 00:00:00 2001 From: Martin Cox Date: Tue, 2 May 2017 21:24:04 +0100 Subject: Added test in httpd_basic_SUTE to validate the correct handling of non-DST dates in the httpd_util:rfc1123_date/1 function. --- lib/inets/test/httpd_basic_SUITE.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index f413248092..a0a38ca103 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -42,7 +42,8 @@ all() -> escaped_url_in_error_body, script_timeout, slowdose, - keep_alive_timeout + keep_alive_timeout, + invalid_rfc1123_date ]. groups() -> @@ -382,6 +383,16 @@ slowdose(Config) when is_list(Config) -> {error, closed} = gen_tcp:send(Socket, "Hey") end. +%%------------------------------------------------------------------------- + +invalid_rfc1123_date() -> + [{doc, "Test that a non-DST date is handled correcly"}]. +invalid_rfc1123_date(Config) when is_list(Config) -> + Rfc1123FormattedDate = "Sun, 26 Mar 2017 01:00:00 GMT", + NonDSTDateTime = {{2017, 03, 26},{1, 0, 0}}, + Rfc1123FormattedDate =:= httpd_util:rfc1123_date(NonDSTDateTime). + + %%------------------------------------------------------------------------- %% Internal functions %%------------------------------------------------------------------------- -- cgit v1.2.3