From 6cb065606b31d168c99cf06d172b1fee7aee4af2 Mon Sep 17 00:00:00 2001 From: Artemis Date: Tue, 13 Feb 2024 15:12:46 +0000 Subject: [PATCH] request English from the Deezer API --- src/deezer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/deezer.rs b/src/deezer.rs index bb0beb9..158bc2d 100644 --- a/src/deezer.rs +++ b/src/deezer.rs @@ -11,7 +11,11 @@ const API_URL: &str = "https://api.deezer.com"; lazy_static! { /// A shared HTTP client for making requests to the API. - static ref CLIENT: reqwest::Client = reqwest::Client::new(); + static ref CLIENT: reqwest::Client = { + let mut headers = reqwest::header::HeaderMap::new(); + headers.insert(reqwest::header::ACCEPT_LANGUAGE, "en".parse().unwrap()); + reqwest::Client::builder().default_headers(headers).build().unwrap() + }; } /// Fetch the "chart" (a list of popular tracks) for a given genre.