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

http: tell the parser about CONNECT responses #6198

Closed
wants to merge 3 commits into from

Commits on Apr 15, 2016

  1. http: tell the parser about CONNECT responses

    This commit fixes a bug in HTTP CONNECT response parsing. The parser
    normally continues to look for additional HTTP messages after the
    first message has completed. However, in the case of CONNECT responses,
    the parser should stop looking for additional messages and treat
    any further data as a separate protocol.
    
    Because of the way that HTTP messages are parsed in JavaScript, this
    bug only manifests itself in the case where the socket's `data'
    handler receives the end of the response message *and also* includes
    non-HTTP data.
    
    In order to implement the fix, an `.upgrade' accessor is exposed to
    JavaScript on the HTTPParser object that proxies the underlying
    http_parser's `upgrade' field. Likewise in JavaScript, the `http'
    client module sets this value to `true' when a response is received
    to a CONNECT request.
    
    The result of this is that callbacks on HTTPParser instances can
    signal that the message indicates a change in protocol and further
    HTTP parsing should not occur.
    slushie committed Apr 15, 2016
    Configuration menu
    Copy the full SHA
    adb1a96 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c295e5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    08284b3 View commit details
    Browse the repository at this point in the history