Skip to content

Commit

Permalink
chore: followRedirect default value is true (#487)
Browse files Browse the repository at this point in the history
代码注释是对的,但是 readme 里的是错误的。
**readme:**

![image](https://github.com/node-modules/urllib/assets/77064828/7c4317d5-0659-41c3-af02-e5fa99714915)
**代码:**

![image](https://github.com/node-modules/urllib/assets/77064828/5e9661af-97d8-4384-bc42-0f638705317e)

------------------------------------------------------------------------
这里也写了个小 demo 验证了一番,确认 followRedirect 的默认值是 true:
https://github.com/SanGuiChen/urllib-redirect-demo

Co-authored-by: xuming.cx <xuming.cx@antgroup.com>
  • Loading branch information
SanGuiChen and xuming.cx authored Jan 22, 2024
1 parent a9c1792 commit f6ac20b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ console.log('status: %s, body size: %d, headers: %j', res.status, data.length, r
- **keepAliveTimeout** `number | null` - Default is `4000`, 4 seconds - The timeout after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. See [MDN: HTTP - Headers - Keep-Alive directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives) for more details.
- ***auth*** String - `username:password` used in HTTP Basic Authorization.
- ***digestAuth*** String - `username:password` used in HTTP [Digest Authorization](https://en.wikipedia.org/wiki/Digest_access_authentication).
- ***followRedirect*** Boolean - follow HTTP 3xx responses as redirects. defaults to false.
- ***followRedirect*** Boolean - follow HTTP 3xx responses as redirects. defaults to true.
- ***maxRedirects*** Number - The maximum number of redirects to follow, defaults to 10.
- ***formatRedirectUrl*** Function - Format the redirect url by your self. Default is `url.resolve(from, to)`.
- ***beforeRequest*** Function - Before request hook, you can change every thing here.
Expand Down

0 comments on commit f6ac20b

Please sign in to comment.