httpd_util:convert_request_date bad_date handling broken?

cayle.spandon@REDACTED cayle.spandon@REDACTED
Fri Aug 14 18:03:32 CEST 2009


httpd_util:convert_request_date/1 is supposed to return bad_date if the  
date string is invalid.

For some string it does indeed do that:

> httpd_util:convert_request_date("Sun, 06 Nov 1994 08:49:37 GMT").
{{1994,11,6},{8,49,37}}

> httpd_util:convert_request_date("Sun, 06 Nov 1994").
bad_date

> httpd_util:convert_request_date("Nonsense").
bad_date

However, for other strings it does not return bad_date:

> httpd_util:convert_request_date("Sun").
** exception error: no function clause matching  
httpd_util:convert_request_date("Sun")

> httpd_util:convert_request_date("-1").
** exception error: no function clause matching  
httpd_util:convert_request_date("-1")

Is this a bug in convert_request_date or am I missing something?


More information about the erlang-questions mailing list