SoftwareGuy / NodeListServer

Node List Server is a multi-purpose server list system. NodeJS powered and supports Docker.
Other
92 stars 33 forks source link

Fix IP/Port collision check always returning false #25

Closed yayza closed 2 years ago

yayza commented 2 years ago

apiDoesThisServerExistByAddressPort expects a number in the servers.port === port check but was being passed a string from the req.body. This was always returning false and allowing duplicate servers to be added.

Also some tiny changes for readability. I was thinking of splitting code into separate modules? I have a WIP that still needs to be cleaned up in my yayza/modules as an example
SoftwareGuy commented 2 years ago

Good find! Thanks for that.

I have been thinking of making it modular but as long as it’s done in a manner that is simple and easy to understand. Last time I looked into modules and tried to implement them it was a complicated mess and I just gave up, hence the one script thing. Probably due to the guide I was reading wasn’t explaining everything I needed to know.

Sent with GitHawk