Giter VIP home page Giter VIP logo

Comments (2)

MignonBelongie avatar MignonBelongie commented on July 28, 2024

I studied this and found a bug in our parser, namely that cookie attribute names in Set-Cookie headers were not being matched case-insensitively, which I fixed in PION-1324.
Unfortunately, this doesn't entirely solve your problem, because you will still get some spurious cookies,
because for backwards compatibility we have to support the possibility of comma separated cookies in Set-Cookie headers, even though such usage is obsolete. Please see the comments in the new code for more information.

from pion.

rafirafi avatar rafirafi commented on July 28, 2024

Ok, I run my example again, and it looks much better :

Set-Cookie: NID=67=fQUaCFOC5HYBfQbH_sPIllgkZDOUq1focANHSckQP9MZxV9oulaBg104XnoOn_KR_e1W03CIuU7aprYUSncwGgrrcMqfzul97WZAvvbd0lXN-2xjoHVZb4aTKid7GX8z; expires=Fri, 27-Feb-2015 19:58:19 GMT; path=/; domain=.google.fr; HttpOnly
Set-Cookie: PREF="ID=ef83f38acec36e29:FF=0:TM=1409255899:LM=1409255899:S=wQNIzayl5DTMkMJr"; Version=1; Path=/
Set-Cookie: NID="67=fQUaCFOC5HYBfQbH_sPIllgkZDOUq1focANHSckQP9MZxV9oulaBg104XnoOn_KR_e1W03CIuU7aprYUSncwGgrrcMqfzul97WZAvvbd0lXN-2xjoHVZb4aTKid7GX8z"; Version=1; Path=/
Set-Cookie: 27-Feb-201519:58:19GMT=""; Version=1; Path=/
Set-Cookie: 27-Aug-201619:58:19GMT=""; Version=1; Path=/
Set-Cookie: PREF=ID=ef83f38acec36e29:FF=0:TM=1409255899:LM=1409255899:S=wQNIzayl5DTMkMJr; expires=Sat, 27-Aug-2016 19:58:19 GMT; path=/; domain=.google.fr

I dug a little and the comma in the "expires" field is a legacy from netscape's time and is actually a part of the format, but was defined before any spec exists.

What I have pasted before is all the Set-Cookies from a single call to:

boost::system::error_code ec;
pion::http::response_ptr response;
// get the response
response->write(std::cout, ec, true);

It displays the Set-Cookie from the response along with the result of the parsing. And if I undestand correctly the comment in the test case this should no longer be the case.

Anyway thanks for your reactivity.

from pion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.