From 5b35ddcd4b8a202d140404e1c597bdbfbc827ee7 Mon Sep 17 00:00:00 2001 From: naturecodevoid <44983869+naturecodevoid@users.noreply.github.com> Date: Sun, 5 Mar 2023 09:28:46 -0800 Subject: [PATCH] ensure both headers are set --- src/provider_instance.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/provider_instance.rs b/src/provider_instance.rs index 69763de..c08f152 100644 --- a/src/provider_instance.rs +++ b/src/provider_instance.rs @@ -130,7 +130,9 @@ impl ProviderInstance { // However, it's actually incorrect, and omnisette will normalize it to be X-Mme-Client-Info when using provider.get_authentication_headers(). // To maintain backwards compatibility with V1 (and older versions of SideStore), we clone the header to ensure it is in both the correct and incorrect header key. // We don't need to do this for V3 (`/get_headers`, get_authentication_headers_unique) because versions of SideStore that support V3 will use the correct header. - if let Some(client_info) = headers.get("X-MMe-Client-Info") { + if let Some(client_info) = headers.get("X-Mme-Client-Info") { + headers.insert("X-MMe-Client-Info".to_string(), client_info.clone()); + } else if let Some(client_info) = headers.get("X-MMe-Client-Info") { headers.insert("X-Mme-Client-Info".to_string(), client_info.clone()); } Ok(headers)