Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slash when adding server causes connection failure #280

Closed
reepy opened this issue Jul 6, 2022 · 4 comments · Fixed by #601
Closed

Trailing slash when adding server causes connection failure #280

reepy opened this issue Jul 6, 2022 · 4 comments · Fixed by #601
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@reepy
Copy link

reepy commented Jul 6, 2022

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 reepy added the bug Something isn't working label Jul 6, 2022
@reepy reepy changed the title Trailing slash when adding server causes Trailing slash when adding server causes connection failure Jul 6, 2022
@Tiagoez
Copy link

Tiagoez commented Jul 6, 2023

Still not fixed 👍

@jaen
Copy link

jaen commented Feb 3, 2024

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.

@sevenrats
Copy link
Member

sevenrats commented Apr 3, 2024

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 sevenrats added the good first issue Good for newcomers label Apr 3, 2024
@oddstr13
Copy link
Member

oddstr13 commented Apr 3, 2024

This is a rather simple one, server needs to have the trailing / stripped here before the public info endpoint is appended.

async function tryConnect(server) {
document.getElementById('connect-button').disabled = true;
try {
if (!server.startsWith("http")) {
server = "http://" + server;
}
const url = new URL("/System/Info/Public", server);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Development

Successfully merging a pull request may close this issue.

5 participants