Skip to content

Commit

Permalink
Add informational comments to the icon_external function
Browse files Browse the repository at this point in the history
Signed-off-by: BlackDex <[email protected]>
  • Loading branch information
BlackDex committed Feb 3, 2025
1 parent e2e6cfc commit a2d7649
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ static CLIENT: Lazy<Client> = Lazy::new(|| {
// Build Regex only once since this takes a lot of time.
static ICON_SIZE_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?x)(\d+)\D*(\d+)").unwrap());

// The function name `icon_external` is checked in the `on_response` function in `AppHeaders`
// It is used to prevent sending a specific header which breaks icon downloads.
// If this function needs to be renamed, also adjust the code in `util.rs`
#[get("/<domain>/icon.png")]
fn icon_external(domain: &str) -> Option<Redirect> {
if !is_valid_domain(domain) {
Expand Down

0 comments on commit a2d7649

Please sign in to comment.