Skip to content

Commit 442e48d

Browse files
ravenergabrielcsapo
authored andcommitted
remove useless 'new' calls (#48)
1 parent d7840c3 commit 442e48d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Service extends HttpDuplex {
5858
if(req.headers["authorization"]) {
5959
const tokens = req.headers["authorization"].split(" ");
6060
if (tokens[0] === "Basic") {
61-
const splitHash = new Buffer.from(tokens[1], 'base64').toString('utf8').split(":");
61+
const splitHash = Buffer.from(tokens[1], 'base64').toString('utf8').split(":");
6262
this.username = splitHash.shift();
6363
}
6464
}
@@ -141,7 +141,7 @@ class Service extends HttpDuplex {
141141
};
142142

143143
self.emit('response', respStream, function endResponse() {
144-
res.queue(new Buffer.from('0000'));
144+
res.queue(Buffer.from('0000'));
145145
res.queue(null);
146146
});
147147

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.from(tokens[1], 'base64').toString('utf8').split(":");
37+
const splitHash = Buffer.from(tokens[1], 'base64').toString('utf8').split(":");
3838
const username = splitHash.shift();
3939
const password = splitHash.join(":");
4040
callback(username, password, null);

0 commit comments

Comments
 (0)