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

Where does this value get set at? #8773

Closed
jcolebrand opened this issue Sep 25, 2016 · 3 comments
Closed

Where does this value get set at? #8773

jcolebrand opened this issue Sep 25, 2016 · 3 comments
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@jcolebrand
Copy link

  • 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.

@jcolebrand
Copy link
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);

@addaleax addaleax added question Issues that look for answers. http Issues or PRs related to the http subsystem. labels Sep 25, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Sep 25, 2016

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

@cjihrig cjihrig closed this as completed Sep 25, 2016
@jcolebrand
Copy link
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
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants