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

Follow HTTP redirect when discovering servers #769

Closed
oczkoisse opened this issue Jun 25, 2023 · 3 comments
Closed

Follow HTTP redirect when discovering servers #769

oczkoisse opened this issue Jun 25, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@oczkoisse
Copy link

I'm following up on an issue I described in jellyfin/jellyfin-android#949 (comment). I've an HTTP redirect set from a custom domain to the Jellyfin server. Works great on browsers with both HTTP and HTTPS, even on LG webos app. The android client, however, refuses to follow the redirect URL and instead lists the tried candidates:

Tried 5 candidates for input, without success.

Unable to reach server:
- https://subdomain.domain.com
- https://subdomain.domain.com:8096
- https://subdomain.domain.com:8920
- http://subdomain.domain.com
- http://subdomain.domain.com:8096

Could it be possible to allow redirected URLs (301/302) to be acceptable as server URLs instead of outright rejecting them? I believe it could be fixed by adjusting the acceptable response code here: https://github.com/jellyfin/jellyfin-sdk-kotlin/blob/master/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/RecommendedServerDiscovery.kt#L125.

@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Jun 25, 2023
@nielsvanvelzen
Copy link
Member

Quoting from a reply to a similar recent question:

Our Android clients do not follow redirects for security reasons. We might add a special case for discovery (when you're adding the server) to save the redirected URL at some point.

We do have support for following redirects in the SDK but it's always disabled during discovery and our official apps always disable it.

We should at the very least change the error message to say something like "ignored redirect for candidate X" and preferably follow the redirect while testing and if it redirects to a valid server show a pop-up to the user to confirm if the address redirected to is valid.

@nielsvanvelzen nielsvanvelzen added good first issue Good for newcomers and removed good first issue Good for newcomers labels Oct 9, 2023
@nielsvanvelzen
Copy link
Member

Looking at the issues now I believe this is really a duplicate of #471 so I'll close this one.

@nielsvanvelzen nielsvanvelzen closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
@unwenliu
Copy link

I'm following up on an issue I described in jellyfin/jellyfin-android#949 (comment). I've an HTTP redirect set from a custom domain to the Jellyfin server. Works great on browsers with both HTTP and HTTPS, even on LG webos app. The android client, however, refuses to follow the redirect URL and instead lists the tried candidates:

Tried 5 candidates for input, without success.

Unable to reach server:
- https://subdomain.domain.com
- https://subdomain.domain.com:8096
- https://subdomain.domain.com:8920
- http://subdomain.domain.com
- http://subdomain.domain.com:8096

Could it be possible to allow redirected URLs (301/302) to be acceptable as server URLs instead of outright rejecting them? I believe it could be fixed by adjusting the acceptable response code here: https://github.com/jellyfin/jellyfin-sdk-kotlin/blob/master/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/RecommendedServerDiscovery.kt#L125.

I'm modified followRedirects=true,compile the sdk and publishToMavenLocal,
jellyfin-andriod project build apk with local sdk,it is not work,can u tell me how to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants