lemmy/crates/api_common/src
Nick Webster a57658d99c
Adding a new config flag to disable pictrs caching for thumbnails (#3897)
* add logic to prevent downloading remote pictrs images

* apply formatting

* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance

* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance and cache_federated_images is false

* Generalising the no caching option to handle all remote images

* rustfmt

* Return None if the URL is not an image

* Updating defaults.hjson

* fixing typo

* Fixing typo

* Skip cloning the Url unless we need to

* using a HEAD request for checking the content type, saving bandwidth/improving perf

* Removing early returns

* Switching back to GET requests for Content-Type because pictrs does not handle HEAD requests

* Simplifying logic and using metadata_image instead of url if we do not get a pictrs thumbnail

* Removing unused import

* Return None as a thumbnail if caching is disabled

* formatting

---------

Co-authored-by: Djones4822 <david.jones4822@gmail.com>
2023-08-31 10:36:39 -04:00
..
build_response.rs Replace Option<bool> with bool for PostQuery and CommentQuery (#3819) (#3857) 2023-08-11 11:13:14 +02:00
comment.rs Allow filtering posts and comments by whether they were liked/disliked - fixes #3401 (#3523) 2023-08-08 11:40:28 +02:00
community.rs add new flag to api (#3363) 2023-06-27 06:45:26 -04:00
context.rs Make functions work with both connection and pool (#3420) 2023-07-11 09:09:59 -04:00
custom_emoji.rs Improve api response times by doing send_activity asynchronously (#3493) 2023-07-10 12:27:49 +02:00
lib.rs Remove SendActivity and Perform traits, rely on channel (#3596) 2023-07-19 09:49:41 -04:00
person.rs Make remove content optional during account deletion (fixes #1617) (#3817) 2023-08-28 12:23:45 +02:00
post.rs update moderator view (#3820) 2023-08-31 13:07:45 +02:00
private_message.rs Allow filtering PMs by sender (#3770) 2023-08-08 11:07:41 +02:00
request.rs Adding a new config flag to disable pictrs caching for thumbnails (#3897) 2023-08-31 10:36:39 -04:00
send_activity.rs Make remove content optional during account deletion (fixes #1617) (#3817) 2023-08-28 12:23:45 +02:00
sensitive.rs Upgrade api_test deps (#2850) 2023-05-10 16:31:37 -04:00
site.rs Make resolve_object not require auth #3685 (#3716) 2023-07-26 12:17:42 -04:00
utils.rs Adding a post_view mode. Fixes #3730 (#3731) 2023-08-31 09:01:08 -04:00