From d172dedf316236a7f42778b889d18ba8a38c41aa Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 31 Jan 2013 13:54:10 +0100 Subject: [PATCH] Fixed HTTP_DATE for GMT+ offset (integer value) --- library/network/protocol/http/src/http_date.e | 1 + library/network/protocol/http/tests/http_date_test_set.e | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/library/network/protocol/http/src/http_date.e b/library/network/protocol/http/src/http_date.e index ac7b9c83..088713b6 100644 --- a/library/network/protocol/http/src/http_date.e +++ b/library/network/protocol/http/src/http_date.e @@ -551,6 +551,7 @@ feature {NONE} -- Implementation err := True end if not err then + i := i + 1 from until i > n or else not s[i].is_digit loop t.extend (s[i].as_upper) i := i + 1 diff --git a/library/network/protocol/http/tests/http_date_test_set.e b/library/network/protocol/http/tests/http_date_test_set.e index 79df3288..ffdd39fc 100644 --- a/library/network/protocol/http/tests/http_date_test_set.e +++ b/library/network/protocol/http/tests/http_date_test_set.e @@ -22,7 +22,6 @@ feature -- Test routines d: HTTP_DATE do s := "Sun, 06 Nov 1994 08:49:37 GMT" - create d.make_from_string (s) assert ("RFC 1123", not d.has_error and then d.string.same_string (s)) create d.make_from_timestamp (d.timestamp) @@ -40,6 +39,14 @@ feature -- Test routines assert ("ANSI format", d.has_error) + + -- Tolerance ... + s := "Sun, 06 Nov 1994 09:49:37 GMT+1" + + create d.make_from_string (s) + assert ("RFC 1123", not d.has_error and then d.string.same_string ("Sun, 06 Nov 1994 08:49:37 GMT")) + + end end