rustdesk / rustdesk-server-pro

Some scripts for RustDesk Server Pro are hosted here.
124 stars 59 forks source link

Trailing slash on API URL causes problems #299

Closed andrewheberle closed 1 month ago

andrewheberle commented 1 month ago

When building a custom client, I just copied and pasted the URL of our RustDesk instance, however this ended up having a trailing slash at the end.

After deploying the custom client to test I noted that the device name and info did not appear in the Web UI as expected and connection logs did not appear as expected either.

When reviewing the logs of the reverse proxy that handles SSL termination in from of the Web UI/API (we use Traefik) I saw HTTP requests like this:

image

In the above there is one client that I fixed the API URL so it didn't have the trailing slash, while the others have not been updated and are getting a 404 response.

21pages commented 1 month ago

Thanks for the feedback, one way is to remove the trailing slash and rebuild the client.

andrewheberle commented 1 month ago

Thanks for the feedback, one way is to remove the trailing slash and rebuild the client.

That is noted, and is exactly what I did to resolve the issue myself, however having a field where you enter a URL I would expect that there should be some validation so it's not possible to end up with a "broken" (or at least semi-working) client.

Having the trailing slash stripped automatically or just not allowing the trailing slash (with some explanation in any error message) would prevent this issue and make RustDesk more admin friendly and robust.

rustdesk commented 1 month ago

The fix (added a warning) has been merged. will be ready in 1.4.1