Merge pull request #119 from redlib-org/fix_unauth

fix(oauth): Make Android user-agent patching unconditional
This commit is contained in:
Matthew Esposito 2024-05-30 18:13:43 -04:00 committed by GitHub
commit 8a3ceaf94a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,11 +181,12 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
) )
}; };
// Check if multi sub requested, or if submitted was requested. If so, replace "Android" with a tricky word. // Replace "Android" with a tricky word.
// Issues: #78/#115, #116 // Issues: #78/#115, #116
if path.contains('+') || path.contains("/submitted") { // If you include the word "Android", you will get a number of different errors
// I guess they don't expect mobile traffic on the endpoints we use
// Scrawled on wall for next poor soul: Run the test suite.
user_agent = user_agent.replace("Android", "Andr\u{200B}oid"); user_agent = user_agent.replace("Android", "Andr\u{200B}oid");
}
// 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.)