lemmy/crates/utils/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
..
rate_limit Cache & Optimize Woodpecker CI (#3450) 2023-07-17 11:04:14 -04:00
settings Adding a new config flag to disable pictrs caching for thumbnails (#3897) 2023-08-31 10:36:39 -04:00
utils Adding a post_view mode. Fixes #3730 (#3731) 2023-08-31 09:01:08 -04:00
apub.rs Fixing `.drone.yml` (#2677) 2023-01-30 14:17:24 -05:00
cache_header.rs Add http cache for webfingers (#3317) 2023-07-19 06:09:04 -04:00
claims.rs Fix time zone handling (#3496) 2023-08-24 11:27:00 -04:00
email.rs Fix wrong SMTP port when TLS is being used (fixes #3574) (#3607) 2023-07-13 13:10:14 +02:00
error.rs Adding a new config flag to disable pictrs caching for thumbnails (#3897) 2023-08-31 10:36:39 -04:00
lib.rs Add http cache for webfingers (#3317) 2023-07-19 06:09:04 -04:00
main.rs Adjust the config check to be a separate faster to compile binary (#3313) 2023-06-26 06:23:21 -04:00
request.rs Add cargo feature for building lemmy_api_common with mininum deps (#2243) 2022-05-03 17:44:13 +00:00
response.rs Fix #3366: Wrap plain-text error responses from the API in JSON (#3559) 2023-07-10 22:44:14 +02:00
version.rs For untagged commits, include hash in version name (fixes #1563) 2021-04-12 13:47:58 +02:00