-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: allow ca
, key
and cert
will be string (regression)
#1676
Conversation
@@ -610,7 +623,7 @@ class Server { | |||
const pems = createCertificate(attrs); | |||
|
|||
fs.writeFileSync(certPath, pems.private + pems.cert, { | |||
encoding: 'utf-8', | |||
encoding: 'utf8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utf8
is right value https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options
Codecov Report
@@ Coverage Diff @@
## master #1676 +/- ##
==========================================
+ Coverage 75.12% 76.17% +1.04%
==========================================
Files 17 17
Lines 591 596 +5
Branches 172 173 +1
==========================================
+ Hits 444 454 +10
+ Misses 113 108 -5
Partials 34 34
Continue to review full report at Codecov.
|
|
||
if (stats) { | ||
// It is file | ||
options.https[property] = fs.readFileSync(path.resolve(value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this have utf8 encoding as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alan-agius4 hm, maybe, can you provide example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need
https://github.com/nodejs/node/blob/master/lib/fs.js#L392
buffer.toString
:
encoding <string> The character encoding to use. Default: 'utf8'.
buf.toString([encoding[, start[, end]]])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So default is utf8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for clarifying
/cc @hiroppy need review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thx!
For Bugs and Features; did you add new tests?
Yes
Motivation / Use-Case
fixes #1674
Breaking Changes
No
Additional Info
It is regression, just not
pfx
can't be string due it is binary format