jellyfin-media-player icon indicating copy to clipboard operation
jellyfin-media-player copied to clipboard

Trailing slash when adding server causes connection failure

Open reepy opened this issue 2 years ago • 2 comments

To reproduce

Steps to reproduce the behavior:

  1. Select 'Add Server'
  2. Enter the 'Host' details with a trailing slash after the port, eg, http://jellyfin:8096/.
  3. You'll notice you get a 'Connection Failure' error.
  4. Remove the trailing slash.
  5. You'll notice you can connect.

Expected behavior

The connection should work regardless of trailing slash.

Desktop

  • OS: Windows
  • Version: 10
  • Installation method: Windows installer
  • Server: 10.8.1 on Linux

Log excerpt

Notice the URL has // which fails on the server.

2022-07-07 01:04:56 [ INFO  ] JS: begin connectToServer 
2022-07-07 01:04:56 [ INFO  ] JS: tryReconnect: http://jellyfin:8096/ 
2022-07-07 01:04:56 [ INFO  ] JS: getTryConnectPromise http://jellyfin:8096/ 
2022-07-07 01:04:56 [ INFO  ] JS: ConnectionManager requesting url: http://jellyfin:8096//system/info/public 
2022-07-07 01:04:56 [ INFO  ] JS: fetchWithTimeout: timeoutMs: 20000, url: http://jellyfin:8096//system/info/public 
2022-07-07 01:04:56 [ INFO  ] JS: fetchWithTimeout: succeeded connecting to url: http://jellyfin:8096//system/info/public 
2022-07-07 01:04:56 [ INFO  ] JS: ConnectionManager response status: 404, url: http://jellyfin:8096//system/info/public 

reepy avatar Jul 06 '22 15:07 reepy

Still not fixed 👍

Tiagoez avatar Jul 06 '23 16:07 Tiagoez

Still doesn't work - maybe it would be good enough to have the form strip the trailing slash on save? If that's acceptable, I could try making a PR with such workaround.

jaen avatar Feb 03 '24 13:02 jaen

i mean at a glance this looks like its probably as simple as needing to check for the trailing slash before appending "/system/info/public". Frankly everybody that supports this repo is super busy and with 10.9 coming out soon its all hands on deck. this should be a simple fix, so, we are looking to you community members for it. fix the string concat and open a PR. edit: @jaen when I wrote this I thought I was on the other issue thread sorry. this was a really strong voice to use with somebody who literally just offered this exact thing, sorry. we would appreciate your contribution.

sevenrats avatar Apr 03 '24 22:04 sevenrats

This is a rather simple one, server needs to have the trailing / stripped here before the public info endpoint is appended. https://github.com/jellyfin/jellyfin-media-player/blob/d05f06da9a8a9ecebeb00ad52210247abb2d9916/native/find-webclient.js#L1-L9

oddstr13 avatar Apr 03 '24 23:04 oddstr13