Skip to content

Commit 8202863

Browse files
hasezoeygabrielcsapo
authored andcommitted
Fix for #38 (#39)
* gitignore update for visual studio, Buffer Fix #38 * Update util.js * Update service.js
1 parent 415e23d commit 8202863

12 files changed

Lines changed: 4 additions & 3 deletions

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ coverage
66
example/test
77
example/tmp
88
package-lock.json
9+
.vs/

β€Žlib/service.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Service extends HttpDuplex {
5050
if(req.headers["authorization"]) {
5151
const tokens = req.headers["authorization"].split(" ");
5252
if (tokens[0] === "Basic") {
53-
const splitHash = new Buffer(tokens[1], 'base64').toString('utf8').split(":");
53+
const splitHash = new Buffer.from(tokens[1], 'base64').toString('utf8').split(":");
5454
this.username = splitHash.shift();
5555
}
5656
}
@@ -116,7 +116,7 @@ class Service extends HttpDuplex {
116116

117117

118118
self.emit('response', respStream, function endResponse() {
119-
res.queue(new Buffer('0000'));
119+
res.queue(new Buffer.from('0000'));
120120
res.queue(null);
121121
});
122122
ps.stdout.pipe(respStream).pipe(res);

β€Žlib/util.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Util = {
3434
} else {
3535
const tokens = req.headers["authorization"].split(" ");
3636
if (tokens[0] === "Basic") {
37-
const splitHash = new Buffer(tokens[1], 'base64').toString('utf8').split(":");
37+
const splitHash = new Buffer.from(tokens[1], 'base64').toString('utf8').split(":");
3838
const username = splitHash.shift();
3939
const password = splitHash.join(":");
4040
callback(username, password, null);

β€Žtest/fixtures/server/tmp/test.git/hooks/applypatch-msg.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/commit-msg.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/post-update.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/pre-applypatch.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/pre-commit.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/pre-push.sampleβ€Ž

100755100644
File mode changed.

β€Žtest/fixtures/server/tmp/test.git/hooks/pre-rebase.sampleβ€Ž

100755100644
File mode changed.

0 commit comments

Comments
Β (0)