pkgs: update redlib
This commit is contained in:
parent
43036422f5
commit
8fb3efeb82
@ -1,30 +0,0 @@
|
||||
From bd47c206a1d94c8382570b69730d72562d777454 Mon Sep 17 00:00:00 2001
|
||||
From: Matthew Esposito <matt@matthew.science>
|
||||
Date: Thu, 30 May 2024 18:08:45 -0400
|
||||
Subject: [PATCH] fix(oauth): Make Android user-agent patching unconditional
|
||||
|
||||
---
|
||||
src/client.rs | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/client.rs b/src/client.rs
|
||||
index 5b8fe8f..5ea9d1c 100644
|
||||
--- a/src/client.rs
|
||||
+++ b/src/client.rs
|
||||
@@ -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.)
|
@ -8,20 +8,20 @@
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "redlib";
|
||||
version = "0.34.0";
|
||||
version = "0.35.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "redlib-org";
|
||||
repo = "redlib";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-JpuCX2ae9me+zHxQj5jqQlgDci2NV+TEVUAqnuTn3cA=";
|
||||
# rev = "refs/tags/v${version}";
|
||||
rev = "793047f63f0f603e342c919bbfc469c7569276fa";
|
||||
hash = "sha256-A6t/AdKP3fCEyIo8fTIirZAlZPfyS8ba3Pejp8J6AUQ=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./auth-fix.patch
|
||||
];
|
||||
|
||||
cargoHash = "sha256-gkRblCHUFiprZeYtu43GIGBZqCq5l/HEGaQN91XbfSs=";
|
||||
cargoHash = "sha256-rJXKH9z8DC+7qqawbnSkYoQby6hBLLM6in239Wc8rvk=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
@ -30,6 +30,7 @@ rustPlatform.buildRustPackage rec {
|
||||
checkFlags = [
|
||||
# All these test try to connect to Reddit.
|
||||
"--skip=test_fetching_subreddit_quarantined"
|
||||
"--skip=test_gated_and_quarantined"
|
||||
"--skip=test_fetching_nsfw_subreddit"
|
||||
"--skip=test_fetching_ws"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user