| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
The true here should include backticks also for consistency.
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
If isServer is not set explicitly then it will be undefined. Does the code really check if the value is false anywhere? Edit: I see that the code relies only on the truthiness/falsiness of isServer. |
Sorry, something went wrong.
|
cc @nodejs/crypto |
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think that this can possibly suffice. There are also context and various other things that needs to be specified. It can't be possible to omit them, so I don't think that there is any point in providing this default values.
Sorry, something went wrong.
There was a problem hiding this comment.
If you would like to make isServer false by default - let's do it explicitly!
Sorry, something went wrong.
There was a problem hiding this comment.
I'll make isServer: false by default (set to false if options is undefined or options.isServer is undefined).
Regarding the context - TLS API says the rest of the options (besides isServer) are optional and seems like _wrapHandle() creates a secureContext if such is not provided.
Sorry, something went wrong.
There was a problem hiding this comment.
Oh... sorry then!
Sorry, something went wrong.
|
Sorry, something went wrong.
|
Why is it needed? Would it be enough to do !!isServer when passing it to the C++ layer? |
Sorry, something went wrong.
|
Well, it is not only passed to the C++ layer - it is also used extensively in _tls_wrap.js. this._tlsOptions.isServer = !!options.isServer but initializing this value with a default boolean (in either way) seems like a harmless and safe thing to do. |
Sorry, something went wrong.
|
@jhamhader It feels like doing !! in one place is simpler. |
Sorry, something went wrong.
|
Done |
Sorry, something went wrong.
There was a problem hiding this comment.
Is this over 80 column limit?
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the thorough review. Fixed that
Sorry, something went wrong.
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options
|
LGTM |
Sorry, something went wrong.
Sorry, something went wrong.
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options PR-URL: #2614 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options PR-URL: #2614 Reviewed-By: Fedor Indutny <fedor@indutny.com>
|
LTS? |
Sorry, something went wrong.
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options PR-URL: nodejs#2614 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options PR-URL: #2614 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Upon creating a TLSSocket object, set the default isServer option to false Updated tls docs and added test-tls-socket-default-options PR-URL: #2614 Reviewed-By: Fedor Indutny <fedor@indutny.com>
| Back | FazBrowse Home | New Git URL |
Upon creating a TLSSocket object without options, default options will be used, which
set the socket as isServer: false
Updated tls docs and added test-tls-socket-default-options
See issue #2394