mirror of
https://github.com/yattee/yattee.git
synced 2025-12-25 06:00:15 +00:00
[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user