Commit Graph

69 Commits

Author SHA1 Message Date
4e2ec3fbc9 fix(oauth): handle case where a rate limit sneaks in 2024-06-27 23:29:55 -04:00
89313f73e6 fix(oauth): atomics to avoid simultaneous token rollover 2024-06-27 23:26:31 -04:00
3bd8b511a7 fix(oauth): strengthen sync guarantees 2024-06-26 23:41:26 -04:00
2e476dea63 fix(oauth): reset rate limit earlier in refresh cycle 2024-06-26 22:16:41 -04:00
07bf20dbc0 feat(oauth): roll over oauth key on rate limit 2024-06-26 19:19:30 -04:00
518bf03e04 fix(client): Add trace logging for ratelimit info, render error page if exceeded 2024-06-26 08:05:22 -04:00
bacc9e35df refactor(oauth): leave android header unmodified (fixes #131) 2024-06-25 19:28:41 -04:00
997cd8f829 feat(bug): Improve bug reporting while keeping logs private 2024-06-19 14:45:32 -04:00
bd47c206a1 fix(oauth): Make Android user-agent patching unconditional 2024-05-30 18:08:45 -04:00
1715b36ae9 Update fix for submitted route 2024-05-29 20:02:56 -04:00
6b11d936b3 Fix clippys 2024-05-29 18:44:19 -04:00
273d889f1b Fix retrieval of multi-subs 2024-05-29 18:36:56 -04:00
3bb5dc5f3e Update dependencies (Hyper v1.x) (#39)
* Cargo update

* Update major non-breaking changes

* Add deprecation feature-flags to hyper v0.14

* Semi-upgrade hyper-rustls

* Revert deprecated warnings
2024-02-06 08:01:59 -05:00
469d0994f1 Handle errors from reddit (#35)
* Fix error handling logic

A 401 code is still an Ok(<...>) response

* Fix json key

* Run `cargo fmt`
2024-02-02 14:53:15 -05:00
3d2c936a9e Refresh OAuth on 401 only (#33) 2024-01-28 09:28:42 -05:00
03e267f02e Fix pedantic clippy 2024-01-27 23:34:23 -05:00
6c2579cda9 Add check for unauthorized - refresh token 2024-01-27 23:31:21 -05:00
9f9ae45f6e Add many Clippy's, fix many Clippy's 2024-01-19 20:16:17 -05:00
95373f8261 More succinct fix to header parsing 2024-01-19 19:06:05 -05:00
fcde6ff689 Fix client.rs - properly return Err on invalid header (fix #28) 2024-01-19 18:58:08 -05:00
6d97f4c8dd Change Tokio tests - fix GHA runner (again) 2023-12-30 21:33:27 -05:00
53e8811f32 Remove all stats tracking (fixes #7) 2023-12-30 10:22:49 -05:00
d86b77ab56 Reset test threads to 1 (should fix test issues in GHA) 2023-12-29 20:33:43 -05:00
90a800ff44 Remove share parameters at canonical_path 2023-12-29 19:34:57 -05:00
45d8f1bbc8 Better handle redirects with new OAuth endpoints 2023-12-29 19:28:41 -05:00
ce0c6eca8a Fix obfuscated link handling 2023-12-28 18:21:07 -05:00
9f41af6eee Improve spoofing - match headers more closely, pull in real versions/builds 2023-12-28 15:37:02 -05:00
9850109326 Minor stylistic changes 2023-12-28 12:42:06 -05:00
42902cc8d0 Add test for popular globalization 2023-12-28 10:40:17 -05:00
c5d11f220e Fix clippy warnings 2023-12-26 18:27:25 -05:00
b0f985c687 Libreddit -> Redlib 2023-12-26 18:25:52 -05:00
b7bf9c74be Fix import error 2023-12-26 15:54:43 -05:00
90d1831352 Merge remote-tracking branch 'origin/pull/819' 2023-12-26 15:48:27 -05:00
cc9023dc64 Merge remote-tracking branch 'origin/pull/865' 2023-12-26 15:12:36 -05:00
f5b54197c4 Merge remote-tracking branch 'origin/pull/808' 2023-12-26 15:11:44 -05:00
3e236e7ab5 client.rs: remove some String allocations 2023-10-27 09:05:22 -04:00
7a14975fb8 Remove 'Nel' and 'Report-To' response headers 2023-07-08 19:20:58 -07:00
5f562876f4 Make stats collection opt-out 2023-06-09 17:26:23 -04:00
c00beaa5d8 Improve OAuth refresh, logging 2023-06-08 14:33:54 -04:00
0ca0eefaa4 Add tests to check fetching sub/user/oauth 2023-06-06 15:28:36 -04:00
659a82bf63 Improve spoofing of devices, handle token refreshes 2023-06-06 15:05:20 -04:00
00355de727 Set proper headers 2023-06-05 20:39:56 -04:00
383d2789ce Initial PoC of spoofing Android OAuth 2023-06-05 20:31:25 -04:00
de68409610 Add request stats to instance info page 2023-05-31 19:39:44 -04:00
412ce8f1f3 Fix default subscriptions (#732)
Co-authored-by: Daniel Valentine <daniel@vielle.ws>
2023-03-08 21:53:23 -07:00
eb07a2ce7c Make gated subreddits accessible by treating them as quarantined (#722)
* Fix gated communities being unviewable by treating them as quarantined

* Show restriction reason in quarantine template

* Add `gated` checks for other requests
2023-02-26 00:40:32 -07:00
58fa213be8 Reuse hyper client. (#727)
Making a new connection on every request is very slow and wasteful, espectially on slower network.

Fix this by reuse a hyper client which shares a connection pool.

I'm able to lower /r/popular loading time from 5s to 1.5s on my machine.
2023-02-26 00:33:55 -07:00
88bed73e5e Extract Location URL path correctly in client::request. (fixes #645) (#646) 2022-11-21 08:58:40 -07:00
465d9b7ba7 Implement 'posts hidden because of NSFW'. (Resolves #159) (#619) 2022-11-07 20:54:49 -07:00
c6487799ed Redirect /:id to canonical URL for post. (#617)
* Redirect /:id to canonical URL for post.

This implements redirection of `/:id` (a short-form URL to a post) to
the post's canonical URL. Libreddit issues a `HEAD /:id` to Reddit to get
the canonical URL, and on success will send an HTTP 302 to a client with
the canonical URL set in as the value of the `Location:` header.

This also implements support for short IDs for non-ASCII posts, c/o
spikecodes.

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
2022-11-05 02:29:04 -06:00