From 3719a922de0ba6b6c37fb54a14b24ab6fa4b7926 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sun, 3 Sep 2023 00:14:18 +0200 Subject: [PATCH] feat(image_proxy.php): fix some issues --- image_proxy.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/image_proxy.php b/image_proxy.php index bf9781d..528288e 100644 --- a/image_proxy.php +++ b/image_proxy.php @@ -3,12 +3,17 @@ require "misc/tools.php"; $url = $_REQUEST["url"]; +$requested_root_domain = get_root_domain($url); + $allowed_domains = array("pinimg.com", "i.pinimg.com", "pinterest.com"); -if (in_array(get_root_domain($url), $allowed_domains)) +if (in_array($requested_root_domain, $allowed_domains)) { - header("Content-type: image/jpeg"); - echo request($url); + $image = $url; + $image_src = request($image); + + header("Content-Type: image/png"); + echo $image_src; } ?>