lgallard / qBittorrent-Controller

qBittorrent Controller - An Android app for controlling qBittorrent servers
MIT License
286 stars 58 forks source link

Remove trimming spaces from hostname #253

Open Psycoguana opened 3 years ago

Psycoguana commented 3 years ago

Hey, first of all, great app, thanks for the amazing development!

I was having connection problems, and after firing up the android logcat I saw this error java.net.UnknownHostException: Invalid host: http://192.168.0.180 :25257/api/v2/torrents/info?filter=all

Looks like my keyboard added a space to the end of the host, it would be really cool if you could update the app to remove trailing spaces.

I tried adding a .trim() here https://github.com/lgallard/qBittorrent-Controller/blob/c0ceea6e281fb54d702d0c17aa8f6c0a5ca8df4f/app/src/main/java/com/lgallardo/qbittorrentclient/SettingsActivity.java#L656

But it's not quite working, I think a trim might also be needed in this function: https://github.com/lgallard/qBittorrent-Controller/blob/c0ceea6e281fb54d702d0c17aa8f6c0a5ca8df4f/app/src/main/java/com/lgallardo/qbittorrentclient/SettingsActivity.java#L564