File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ Revision history for HTTP-Cookies. The HTTP::Cookies module used to be bundled
2
2
with the libwww-perl distribution.
3
3
4
4
{{$NEXT}}
5
+ - do not set discard if max-age is set (GH#61) (robnagler, simbabque)
5
6
6
7
6.09 2020-11-19 22:20:47Z
7
8
- Allow HttpOnly cookies to be loaded by HTTP::Cookies::Netscape (GH#63)
Original file line number Diff line number Diff line change 1
1
# !perl -w
2
2
3
3
use Test;
4
- plan tests => 80 ;
4
+ plan tests => 81 ;
5
5
6
6
use HTTP::Cookies;
7
7
use HTTP::Request;
@@ -605,7 +605,7 @@ $c->add_cookie_header($req);
605
605
ok(!$req -> header(" Cookie" ));
606
606
607
607
608
- # Test cookie called 'exipres ' <https://rt.cpan.org/Ticket/Display.html?id=8108>
608
+ # Test cookie called 'expires ' <https://rt.cpan.org/Ticket/Display.html?id=8108>
609
609
$c = HTTP::Cookies-> new;
610
610
$req = HTTP::Request-> new(" GET" => " http://example.com" );
611
611
$res = HTTP::Response-> new(200, " OK" );
@@ -734,6 +734,19 @@ $h = $req->header("Cookie");
734
734
ok($h =~ / foo=bar/ );
735
735
unlink ($file ) || warn " Can't unlink $file : $! " ;
736
736
737
+ # Test discard isn't set when max-age is set
738
+ $c = HTTP::Cookies-> new;
739
+ $req = HTTP::Request-> new(" GET" => " http://example.com" );
740
+ $res = HTTP::Response-> new(200, " OK" );
741
+ $res -> request($req );
742
+ $res -> header(" Set-Cookie" => " foo=bar; max-age=1337" );
743
+ $c -> extract_cookies($res );
744
+ # print $c->as_string;
745
+ ok($c -> as_string, <<'EOT' );
746
+ Set-Cookie3: foo=bar; path="/"; domain=example.com; version=0
747
+ EOT
748
+
749
+
737
750
738
751
# -------------------------------------------------------------------
739
752
You can’t perform that action at this time.
0 commit comments