Skip to content

Commit

Permalink
Most of codacy warnings resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Snafkin547 committed Jun 10, 2024
1 parent 1348376 commit d8122b7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/client/socket/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,21 @@ class SocketEvent {
}
});

this.jiffClient.socket.on('crypto_provider', (_msg, callback) => {
this.jiffClient.socket.on('crypto_provider', (msg, callback) => {
callback(true); // send ack to server
const msg = JSON.parse(_msg);
this.jiffClient.handlers.receive_crypto_provider(msg);
if (msg.op_id != null) {
const msg = JSON.parse(msg);

Check failure on line 86 in lib/client/socket/events.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/client/socket/events.js#L86

Passing untrusted user input in `xpath.parse()` can result in XPATH injection vulnerability.
this.jiffClient.handlers.receive_crypto_provider(msg);
}
});

this.jiffClient.socket.on('error', (_msg) => {
const msg = JSON.parse(_msg);
this.jiffClient.handlers.error(msg['label'], msg['error']);
this.jiffClient.handlers.error('socket.io', _msg);
this.socket.on('error', (msg) => {

Check warning on line 91 in lib/client/socket/events.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/client/socket/events.js#L91

Detect inappropriate function body content
try {
msg = JSON.parse(msg);
this.jiffClient.handlers.error(msg['label'], msg['error']);
} catch (error) {
this.jiffClient.handlers.error('socket.io', msg);
}
});

this.jiffClient.socket.on('disconnect', (reason) => {
Expand Down

0 comments on commit d8122b7

Please sign in to comment.