diff options
author | Ingela Andin <[email protected]> | 2017-05-08 11:25:20 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-05-08 11:25:20 +0200 |
commit | 66c23a4fa9f92eb510cf55daa17822c926d7c147 (patch) | |
tree | 56c96ff66bc25718db56ae5acc8f86875b47b5e9 /lib/inets/src/http_server | |
parent | 0be5bebb76d8685f0ecb28f80928c7a3f3a4b3ed (diff) | |
parent | e2b0e1828957e53063a2fa8f39188017a44a2c32 (diff) | |
download | otp-66c23a4fa9f92eb510cf55daa17822c926d7c147.tar.gz otp-66c23a4fa9f92eb510cf55daa17822c926d7c147.tar.bz2 otp-66c23a4fa9f92eb510cf55daa17822c926d7c147.zip |
Merge pull request #1428 from martincox/master
Error when a non-DST time is passed to the httpd_util:rfc1123_date/1 function
OTP-14394
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r-- | lib/inets/src/http_server/httpd_util.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_util.erl b/lib/inets/src/http_server/httpd_util.erl index a647f04ddc..4f771015a6 100644 --- a/lib/inets/src/http_server/httpd_util.erl +++ b/lib/inets/src/http_server/httpd_util.erl @@ -333,7 +333,9 @@ rfc1123_date(LocalTime) -> {{YYYY,MM,DD},{Hour,Min,Sec}} = case calendar:local_time_to_universal_time_dst(LocalTime) of [Gmt] -> Gmt; - [_,Gmt] -> Gmt + [_,Gmt] -> Gmt; + % Should not happen, but handle the empty list to prevent an error. + [] -> LocalTime end, DayNumber = calendar:day_of_the_week({YYYY,MM,DD}), lists:flatten( |