Skip to content

Where does this value get set at? #8773

Description

@jcolebrand
  • Version: master
  • Platform: source
  • Subsystem: http

https://github.com/nodejs/node/blob/master/lib/_http_server.js#L93

I'm reading through the code, looking to understand things, and I don't see where this value gets set in the codebase anywhere. I'm missing something, and I'm pretty sure the value is intended to be if the Transfer-Encoding is set, but I'm not sure how it gets set for this to ever return.

I didn't put the version that I'm on because I'm just in the source code, this isn't an issue with something running anywhere, I'm just trying to learn. If it helps I've got 6.6 on my system, but literally there is no code running anywhere that I'm affected by this in any way.

Activity

  1. jcolebrand commented on Sep 25, 2016

    @jcolebrand
    Author
    function ServerResponse(req) {
      OutgoingMessage.call(this);
    
      if (req.method === 'HEAD') this._hasBody = false;
    
      this.sendDate = true;
    
      if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) {
        this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te);
        this.shouldKeepAlive = false;
      }
    }
    

    Specifically the req.headers.te for those looking at this in the future wondering what in the world I'm talking about. Probably should link to the latest hash instead of what I put in the actual ticket ...

    this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te);

  2. added
    questionIssues asking questions about Node.js.
    httpIssues and PRs related to the http subsystem.
    on Sep 25, 2016
  3. cjihrig commented on Sep 25, 2016

    @cjihrig
    Contributor

    It refers to the TE HTTP request header, not a value that Node specifically computes.

  4. jcolebrand commented on Sep 25, 2016

    @jcolebrand
    Author

    Oh, /facepalm https://en.wikipedia.org/wiki/List_of_HTTP_header_fields

    Yes yes, I see it. Sorry, thanks @cjihrig

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues and PRs related to the http subsystem.questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions