Fix retrieval of multi-subs
This commit is contained in:
parent
27f25e0fb1
commit
273d889f1b
@ -170,7 +170,7 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
|
|||||||
// Construct the hyper client from the HTTPS connector.
|
// Construct the hyper client from the HTTPS connector.
|
||||||
let client: Client<_, Body> = CLIENT.clone();
|
let client: Client<_, Body> = CLIENT.clone();
|
||||||
|
|
||||||
let (token, vendor_id, device_id, user_agent, loid) = {
|
let (token, vendor_id, device_id, mut user_agent, loid) = {
|
||||||
let client = block_on(OAUTH_CLIENT.read());
|
let client = block_on(OAUTH_CLIENT.read());
|
||||||
(
|
(
|
||||||
client.token.clone(),
|
client.token.clone(),
|
||||||
@ -180,6 +180,12 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
|
|||||||
client.headers_map.get("x-reddit-loid").cloned().unwrap_or_default(),
|
client.headers_map.get("x-reddit-loid").cloned().unwrap_or_default(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Check if multi sub requested. If so, replace "Android" with a tricky word.
|
||||||
|
if path.contains("+") {
|
||||||
|
user_agent = user_agent.replace("Android", "Android");
|
||||||
|
}
|
||||||
|
|
||||||
// Build request to Reddit. When making a GET, request gzip compression.
|
// Build request to Reddit. When making a GET, request gzip compression.
|
||||||
// (Reddit doesn't do brotli yet.)
|
// (Reddit doesn't do brotli yet.)
|
||||||
let builder = Request::builder()
|
let builder = Request::builder()
|
||||||
|
Loading…
Reference in New Issue
Block a user