Commit Graph

54 Commits

Author SHA1 Message Date
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
ae3ea2da7c HTTP compression (Reddit -> Libreddit -> client) (#612)
Implements HTTP compression, between both Reddit and Libreddit and Libreddit
and a web browser. Compression between Reddit and Libreddit is mandatory,
whereas compression between Libreddit and a client is opt-in (client must
specify a compressor in the Accept-Encoding header).

Supported compressors are gzip and brotli. gzip support is ubiquitous,
whereas brotli is supported by almost all modern browsers except Safari
(iOS, iPhone, macOS), although Safari may support brotli in the future.

Co-authored-by: Matthew E <matt@matthew.science>
2022-11-03 22:04:34 -06:00
90828cc71c Fix "Post url contains non-ASCII characters" error (#479) 2022-05-21 05:48:59 +00:00
7aeabfc4bc Rewrite Reddit post links to Libreddit equivalents 2021-12-26 21:18:20 -08:00
0656756d21 Fix #196 2021-11-29 22:29:41 -08:00
4faa9d46d6 Fix HTTPS connector 2021-11-21 22:44:05 -08:00
41b3dc5739 More apt error messages for Reddit outages 2021-08-11 20:49:42 -07:00
4defb58f2a Optimizations and commenting 2021-05-20 12:24:06 -07:00
8bb247af3b Added support for quarantined subreddits (#219)
* Added support for quarantined subreddits

* Added confirmation wall for quarantined subreddits

* Added quarantine walls to other routes and fixed case issue

* Correct obsolete use of cookie()

* Refactor param() and quarantine()

Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
2021-05-16 15:53:39 +00:00
928907086c HLS video playback (#182)
* HLS video playback

Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com>

* Add LibreJS compliance

* Locally host hls.js

* Notification about HLS under videos that support it

Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com>

* Use .contains() instead of .find() == None

* Make list of preferences constant

* Change headers_keys from Vector into Array

* Fix incorrect detecting of # in paths

* Remove trailing-slash-appending if statement

* Change HLS notification styling

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
2021-05-10 01:25:52 +00:00
a18db1e2b7 Properly pass preview queries to media proxy 2021-04-08 22:26:03 -07:00
66ac72beab Fix clippy errors 2021-03-26 20:00:47 -07:00
0bb1677520 Revert client to HTTP/1.1 2021-03-21 13:56:05 -07:00
da4883db29 Upgrade client to HTTP/2 2021-03-21 11:37:03 -07:00
dc7e087ed0 Truncate negative scores 2021-03-19 22:04:44 -07:00
a81502dde1 Fix wiki routing 2021-03-17 21:40:55 -07:00