Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect response's Set-Cookie header on HTTP::Response#next-request #156

Open
astj opened this issue Nov 6, 2016 · 2 comments
Open

Respect response's Set-Cookie header on HTTP::Response#next-request #156

astj opened this issue Nov 6, 2016 · 2 comments
Assignees

Comments

@astj
Copy link

astj commented Nov 6, 2016

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.

@jonathanstowe
Copy link
Collaborator

Yep, that's almost certainly right, I'll see if I can do that this afternoon without breaking anything.

@jonathanstowe
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants