Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Stop parsing headers when switching to unknown protocols #899
- unknown protocols probably won't send more headers (e.g. WebSocket) - improved comments and moved them to the correct case statements
Can you explain what you are trying to do here, isn't it correct to continue to read headers on 101? For example consider this server response (cribbed from wikipedia)
Exactly, the new protocol doesn't actually start until after the set of HTTP/1 headers. Explained in RFC 7230 section 6.7.
But exactly how libcurl should behave in the case of a protocol upgrade to a protocol libcurl doesn't understand has never been defined and documented clearly.
The code that I have changed gets executed after an empty header line (= end of headers) has been read. It's inside the "if" starting at https://github.com/mkauf/curl/blob/c8a077a2ecc12a7b601a00b3531b79c106b4e49e/lib/http.c#L3022
That's right... but probably this protocol does not use HTTP headers (e.g. WebSocket)