Git Product home page Git Product logo

Comments (7)

ixti avatar ixti commented on July 17, 2024

@justindarby Can you please provide a sample of response? Pull request, which you referencing was closed as it was fixed actually (if I'm not missing anything):

parser = HTTP::Parser.new
parser << "HTTP/1.1 204 No Content\r\nSet-Cookie: foo=1;\r\nSet-Cookie: bar=2;"
parser.headers # => {"Set-Cookie"=>["foo=1;", "bar=2;"]}

from http.

justindarby avatar justindarby commented on July 17, 2024

I think I might understand why this is broken.

parser = HTTP::Parser.new
parser << "HTTP/1.1 200 Stuff\r\nCache-Control: no-cache\r\nContent-Length: 3\r\nContent-Type: text/xml;charset=UTF-8\r\nContent-Language: en\r\nServer: Microsoft-IIS/7.5\r\nset-cookie: _secret=magic; Version=1; Path=/obscured_path; HTTPOnly\r\nset-cookie: _moresecrets=magic2; Version=1; Path=/obscured_path2; HTTPOnly\r\nX-Powered-By: ASP.NET\r\nDate: Fri, 31 Jan 2014 15:43:22 GMT\r\nSet-Cookie: lbvendor-cookie_https=somestuffthatdoesthings0; path=/\r\n\r\n</>"

The back-end server is actually using a mix of lowercase set-cookie and Set-Cookie because it's a poorly written giant vendor application. It's working here but we have two sets, Set-Cookie and set-cookie, and I bet Set-Cookie is winning somewhere else during normalization?

from http.

ixti avatar ixti commented on July 17, 2024

Ah. That makes sense. Headers are normalized indeed.
An easy fix though.

from http.

sferik avatar sferik commented on July 17, 2024

@ixti Can you please add tests that verify this fix and prevent future regressions?

from http.

ixti avatar ixti commented on July 17, 2024

Yeah. Was going at first place, but then got too lazy. Will do today.

from http.

ixti avatar ixti commented on July 17, 2024

@sferik That was a good idea - that place had hidden bugs indeed

from http.

ixti avatar ixti commented on July 17, 2024

See 9736b8a and b1263f0

from http.

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.