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

avoid using Buffer constructor #206

Merged
merged 1 commit into from
Jan 11, 2019

Conversation

thefourtheye
Copy link
Contributor

No description provided.

@@ -52,7 +52,7 @@ function buildParametersForRepo (options, repo) {

function triggerBuild (options, cb) {
const { repo } = options
const base64Credentials = new Buffer(jenkinsApiCredentials).toString('base64')
const base64Credentials = Buffer.from(jenkinsApiCredentials, 'base64')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't toString() still need to be called?

This diff should make things ok, I believe:

Suggested change
const base64Credentials = Buffer.from(jenkinsApiCredentials, 'base64')
const base64Credentials = Buffer.from(jenkinsApiCredentials).toString('base64')

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW

@phillipj phillipj merged commit 8a17df4 into nodejs:master Jan 11, 2019
@thefourtheye thefourtheye deleted the avoid-using-buffer-constructor branch January 15, 2019 07:19
phillipj pushed a commit that referenced this pull request Jan 15, 2019
The existing code assumes that the credentials are already in base64,
but they are actually not. The code has to read the credentials in plain
text and base 64 encode them.

Ref: #206 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants