Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
48 stars 13 forks source link

URL is not replaced correctly when using standard ports #14

Closed MeridianGH closed 10 months ago

MeridianGH commented 10 months ago

Hey again, I found an issue when debugging a bit.

When using standard ports (in my test 443, port 80 probably throws the same error) I get an error when trying to skip songs.

Turns out, that the Node.updatePlayer function constructs an URL using new URL(...) and therefore loses the port (because it is standard). When trying to replace the poolAddress, the substring can't be replaced due to the missing port. See: here

A possible fix would be instead of using .toString().replace(...) to just get the URL parts manually:

r.path = url.pathname + url.search;

There may be more places where this might be an issue, but I haven't come around to testing all cases.

Tomato6966 commented 10 months ago

I already pushed an fix for that in the past hugh, ill look into it tmr thx

MeridianGH commented 10 months ago

Yeah, my bad. I haven't updated NPM in a while. The recent fix resolved this issue.