[invidious] default thumbnail hostname to configured URL's

For context, Invidious performs a type check of its configuration during
bootup, and allows the "domain" to be unspecified, in which case the API
and HTML it generates includes path-only URLs. This is valid: in these
cases we should assume that the Host for those URLs is the same as
the Host we used to access the endpoint called.

This commit adds support for servers configured in such a way, by
defaulting the host of thumbnail URLs, to that used for authentication.
This commit is contained in:
telyn
2025-12-22 14:59:39 +00:00
parent b38bd3f444
commit 6f696c9262

View File

@@ -612,6 +612,9 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
// Some instances are not configured properly and return thumbnail links
// with an incorrect scheme or a missing port.
components.scheme = accountUrlComponents.scheme
if (components.host ?? "") == "" {
components.host = accountUrlComponents.host
}
components.port = accountUrlComponents.port
// If basic HTTP authentication is used,