Repository navigation
Conversation
…lags - disableTLSCerts() sets rejectUnauthorized to false, not true (docs and JSDoc) - add disableTLSCerts to the list of agent default methods - add the res.redirect, res.created and res.unprocessableEntity flags that Response sets - note that HEAD requests in Node follow no redirects by default, and refer to req.redirects(n) instead of res.redirects(n) - remove a stray semicolon that made the retry example a syntax error Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQDmA3mwGfL83pbg9WQ6ey
Collaborator
|
Thanks, every correction checks out against the source. The commit also applies them to the Chinese and Korean HTML pages and regenerates Consider supporting our efforts to maintain this project by using Forward Email for your email infrastructure needs at https://forwardemail.net. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I checked the docs against the current code on master and ran each claim against a local build (
npm run build:lib). These are the places where the docs and the code disagree.Changes
.disableTLSCerts()setsrejectUnauthorized=false, nottrue. The TLS options section (and the JSDoc insrc/node/index.js) saidtrue. The code doesoptions.rejectUnauthorized = !this._disableTLSCerts. I wrappedhttps.requestand calledrequest.get('https://127.0.0.1:1/').disableTLSCerts(). The captured option wasfalse.Agents accept
disableTLSCertsas a default. It is in thedefaultsarray insrc/agent-base.jsbut was missing from the list in "Default options for multiple requests".typeof request.agent().disableTLSCertsis'function', and calling it records{ fn: 'disableTLSCerts' }in the agent defaults.Response status flags.
ResponseBase#_setStatusPropertiesalso setsres.redirect,res.createdandres.unprocessableEntity, which the list left out. Against a local server, a 201 gavecreated=true, a 302 gaveredirect=true(with.redirects(0)), and a 422 gaveunprocessableEntity=true.HEAD requests do not follow redirects by default in Node. The Node
Requestconstructor callsthis.redirects(method === 'HEAD' ? 0 : 5). A local302 -> /endreturned 200 forrequest.get(), butrequest.head()failed with status 302. Adding.redirects(5)made the HEAD request return 200. I added a sentence about this. I also changedres.redirects(n)toreq.redirects(n), since it is a request method.Retry example syntax error. The example had
.then(finished);followed by.catch(failed);.node --checkon that snippet givesSyntaxError: Unexpected token '.'. With the semicolon removed it parses.I made the same code-level fixes (1, 2, 3, the semicolon, and
req.redirects(n)) indocs/zh_CN/index.mdanddocs/ko_KR/index.md. I did not add the HEAD sentence to the translations, because I did not want to write new Chinese or Korean prose.Testing
npx eslint -c .eslintrc src/node/index.jspasses (one existingno-unused-varswarning, unrelated).make test-node: 414 passing. The only 2 failures are the IPv6 tests, which fail because my machine has no IPv6. The source change is a comment only.index.html, following CONTRIBUTING.