Skip to content

Commit

Permalink
fix(server): a failed ip match would still attempt to be read
Browse files Browse the repository at this point in the history
parseOutIPAddress wasn't correctly checking for the result of string match been an array
  • Loading branch information
NotExpectedYet committed Oct 1, 2022
1 parent 00ceee7 commit 89e543f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/utils/url.utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function isValidHttpUrl(string) {
let url;
let url = null;
try {
url = new URL(string);
} catch (e) {
Expand Down Expand Up @@ -31,8 +31,13 @@ function parseOutIPAddress(string) {

const t = string.match(r);

if(Array.isArray(t)){
return false
}

return t[0];
}
return false
}

function convertHttpUrlToWebsocket(url) {
Expand Down

0 comments on commit 89e543f

Please sign in to comment.