Skip to content

Commit

Permalink
docs: proxied images can only be PNG
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jun 27, 2023
1 parent f20a8de commit acf5728
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Binary file added docs/media/torrust_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions src/web/api/v1/contexts/proxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//! - Avoid storing images on the server.
//!
//! The proxy service is a simple cache that stores the images in memory.
//!
//! **NOTICE:** For now, it only supports PNG images.
//!
//! **NOTICE:** The proxy service is not intended to be used as a general
//! purpose proxy. It is only intended to be used for the images in the
Expand All @@ -18,6 +20,16 @@
//! with the text "Sign in to see image" instead.
//!
//! # Example
//!
//! The PNG image:
//!
//! <https://raw.githubusercontent.com/torrust/torrust-index-backend/develop/docs/media/torrust_logo.png>
//!
//! The percent encoded image URL:
//!
//! ```text
//! https%3A%2F%2Fraw.githubusercontent.com%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png
//! ```
//!
//! For unauthenticated clients:
//!
Expand All @@ -26,7 +38,7 @@
//! --header "cache-control: no-cache" \
//! --header "pragma: no-cache" \
//! --output mandelbrotset.jpg \
//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F2%2F21%2FMandel_zoom_00_mandelbrot_set.jpg%2F1280px-Mandel_zoom_00_mandelbrot_set.jpg
//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fraw.githubusercontent.com%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png
//! ```
//!
//! You will receive an image with the text "Sign in to see image" instead.
Expand All @@ -39,7 +51,7 @@
//! --header "cache-control: no-cache" \
//! --header "pragma: no-cache" \
//! --output mandelbrotset.jpg \
//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F2%2F21%2FMandel_zoom_00_mandelbrot_set.jpg%2F1280px-Mandel_zoom_00_mandelbrot_set.jpg
//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fraw.githubusercontent.com%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png
//! ```
pub mod handlers;
pub mod responses;
Expand Down

0 comments on commit acf5728

Please sign in to comment.