fix(api): send Jellyfin key in Authorization header
ci / web (pull_request) Successful in 1m24s
e2e / e2e (pull_request) Successful in 3m9s
ci / rust (pull_request) Successful in 3m30s
ci / image (pull_request) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-11-15 17:10:48 +00:00
co-authored by Claude Opus 5.5
parent 189f66af0d
commit a0e346647f
+3 -2
View File
@@ -50,7 +50,8 @@ impl JellyfinClient {
let url = format!("{}/Library/Refresh", self.base_url.trim_end_matches('/'));
let mut request = self.client.post(url);
if let Some(key) = &self.api_key {
request = request.header("X-Emby-Token", key);
// Jellyfin 12 rejects the legacy `X-Emby-Token` header with 401.
request = request.header("Authorization", format!("MediaBrowser Token=\"{key}\""));
}
let response = request.send().await?;
if !response.status().is_success() {
@@ -73,7 +74,7 @@ mod tests {
let server = MockServer::start().await;
Mock::given(method("POST"))
.and(path("/Library/Refresh"))
.and(header("X-Emby-Token", "secret"))
.and(header("Authorization", "MediaBrowser Token=\"secret\""))
.respond_with(ResponseTemplate::new(204))
.mount(&server)
.await;