Fixed HTTP_DATE for GMT+ offset (integer value)

This commit is contained in:
Jocelyn Fiat
2013-01-31 13:54:10 +01:00
parent 20d5798444
commit d172dedf31
2 changed files with 9 additions and 1 deletions

View File

@@ -551,6 +551,7 @@ feature {NONE} -- Implementation
err := True err := True
end end
if not err then if not err then
i := i + 1
from until i > n or else not s[i].is_digit loop from until i > n or else not s[i].is_digit loop
t.extend (s[i].as_upper) t.extend (s[i].as_upper)
i := i + 1 i := i + 1

View File

@@ -22,7 +22,6 @@ feature -- Test routines
d: HTTP_DATE d: HTTP_DATE
do do
s := "Sun, 06 Nov 1994 08:49:37 GMT" s := "Sun, 06 Nov 1994 08:49:37 GMT"
create d.make_from_string (s) create d.make_from_string (s)
assert ("RFC 1123", not d.has_error and then d.string.same_string (s)) assert ("RFC 1123", not d.has_error and then d.string.same_string (s))
create d.make_from_timestamp (d.timestamp) create d.make_from_timestamp (d.timestamp)
@@ -40,6 +39,14 @@ feature -- Test routines
assert ("ANSI format", d.has_error) 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
end end