Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oauth): Make Android user-agent patching unconditional #119

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
if path.contains('+') || path.contains("/submitted") {
user_agent = user_agent.replace("Android", "Andr\u{200B}oid");
}
// 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");

// Build request to Reddit. When making a GET, request gzip compression.
// (Reddit doesn't do brotli yet.)
Expand Down
Loading