diff --git a/image_proxy.php b/image_proxy.php index 528288e..c24686d 100644 --- a/image_proxy.php +++ b/image_proxy.php @@ -1,19 +1,26 @@ buffer($image_src); + if (strpos($mime_type, 'image/') === 0) { + header("Content-Type: $mime_type"); + echo $image_src; + } else { + header("HTTP/1.1 415 Unsupported Media Type"); + echo "Error: The requested URL does not contain a valid image."; + } + } else { + header("HTTP/1.1 404 Not Found"); + echo "Error: Unable to fetch the image."; + } +} else { + header("HTTP/1.1 400 Bad Request"); + echo "Error: Invalid domain."; } - ?>