File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ enum PickDateFormat {
3535 /// - `Fri Feb 15 14:45:01 2013`
3636 ANSI_C_asctime ,
3737
38- /// A valid but rarely used format for HTTP date headers
38+ /// A valid but rarely used format for HTTP date headers, and cookies
3939 ///
4040 /// https://datatracker.ietf.org/doc/html/rfc850, obsolete by
4141 /// [RFC 1036] (https://datatracker.ietf.org/doc/html/rfc1036)
@@ -196,8 +196,8 @@ extension NullableDateTimePick on Pick {
196196 final value = required ().value;
197197 if (value is ! String ) return null ;
198198 try {
199- final rfc850Regex =
200- RegExp ( r'^\s*(\S+),\s*(\d+)-(\S{3})-(\d+)\s+(\d+):(\d+):(\d+)\s*GMT' );
199+ final rfc850Regex = RegExp (
200+ r'^\s*(\S+),\s*(\d+)-(\S{3})-(\d+)\s+(\d+):(\d+):(\d+)\s*( GMT|UT) ' );
201201 final match = rfc850Regex.firstMatch (value)! ;
202202 final day = int .parse (match.group (2 )! );
203203 final month = _months[match.group (3 )! ]! ;
Original file line number Diff line number Diff line change @@ -424,7 +424,10 @@ void main() {
424424 );
425425 });
426426
427- test ('only allows GMT' , () {
427+ test ('only allows GMT/UT as time zone' , () {
428+ pick ('Sunday, 06-Nov-94 08:49:37 GMT' ).asDateTimeOrThrow (); // ok
429+ pick ('Sunday, 06-Nov-94 08:49:37 UT' ).asDateTimeOrThrow (); // ok
430+
428431 expect (
429432 () => pick ('Sunday, 6-Nov-94 08:49:37 PST' ).asDateTimeOrThrow (),
430433 throwsA (pickException (
You can’t perform that action at this time.
0 commit comments