http-useragent
http-useragent copied to clipboard
Respect response's Set-Cookie header on HTTP::Response#next-request
Currently, HTTP::Response#next-request
doesn't care about Set-Cookie
header of the response (understand just Location
header).
So, If someone wants to request with some received Cookie (like session Cookie), one has to set Cookie manually like following:
my $next-req = $res.next-request;
my $cookies = HTTP::Cookies.new;
$cookies.extract-cookies($res);
$next-req.add-cookies($cookies);
I think it's useful if HTTP::Response#next-request
understands response's Set-Cookie
header and automatically set Cookies to the next request.
Yep, that's almost certainly right, I'll see if I can do that this afternoon without breaking anything.
Hmm this would be fine, if the domain check was implemented properly on the add-cookies :(
I'm going to put another issue in to fix that first, before doing this, as I'd rather not be making things actually more insecure than they are.