File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,9 @@ sub extract_cookies
237
237
$expires ++;
238
238
}
239
239
}
240
+ elsif (!$first_param && lc ($k ) =~ / ^(?:version|discard|ns-cookie)/ ) {
241
+ # ignore
242
+ }
240
243
else {
241
244
push (@cur , $k => $v );
242
245
}
Original file line number Diff line number Diff line change 1
- print " 1..44 \n " ;
1
+ print " 1..45 \n " ;
2
2
3
3
# use LWP::Debug '+';
4
4
use HTTP::Cookies;
@@ -678,6 +678,17 @@ print "not " unless $c->as_string eq <<'EOT'; print "ok 44\n";
678
678
Set-Cookie3: CUSTOMER=WILE_E_COYOTE; path="/"; domain=example.com; path_spec; discard; version=0
679
679
EOT
680
680
681
+ # Test Set-Cookie with version set
682
+ $c = HTTP::Cookies->new;
683
+ $res ->header("Set-Cookie" => "foo=\" bar\" ;version=1");
684
+ #print $res ->as_string;
685
+ $c ->extract_cookies($res );
686
+ #print $c ->as_string;
687
+ $req = HTTP::Request->new(GET => "http://www.example.com/foo");
688
+ $c ->add_cookie_header($req );
689
+ #print $req ->as_string;
690
+ print "not " unless $req ->header("Cookie") eq "foo=\" bar\" ";
691
+ print "ok 45\n ";
681
692
682
693
#-------------------------------------------------------------------
683
694
You can’t perform that action at this time.
0 commit comments