Skip to content

Commit

Permalink
Fixed host error
Browse files Browse the repository at this point in the history
  • Loading branch information
therohitdas committed Jan 25, 2022
1 parent 623ac70 commit ac97fa1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion image.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
$origin = explode(":", $origin);
$origin = $origin[0];

error_log($origin);

$imageUploader = new ImageUploader();
$imageUploader->setPath($filePath);
$imageUploader->setSalt($salt);
Expand Down Expand Up @@ -84,7 +86,7 @@
}
elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
// allowed host check
if (!in_array($origin, $allowed_hosts)) {
if ($origin !== false && (!in_array($origin, $allowed_hosts))) {
echo json_encode(array("error" => "Unauthorized"));
die();
}
Expand Down

0 comments on commit ac97fa1

Please sign in to comment.