Skip to content

Commit

Permalink
the effect to which the negotiation should be applied was fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiLeni committed Feb 6, 2023
1 parent 336fdb7 commit d7b574a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ function negotiateFormat($ep)
// check if the requested image has the 'negotiator' effect
$set_effects = $subject->effectsFromType($subject->getMediaType());
$set_effects = array_column($set_effects, 'effect');
$type = $subject->getMediaType();

// if not, skip
if (!in_array('negotiator', $set_effects)) {
return $subject;
}

// if yes, set cache path
if (in_array($type, ['avif'])) {
} else {
// if yes, set cache path
$possible_types = rex_server('HTTP_ACCEPT', 'string', '');
$types = explode(',', $possible_types);

Expand All @@ -31,6 +28,7 @@ function negotiateFormat($ep)
}
}


return $subject;
}

Expand Down

0 comments on commit d7b574a

Please sign in to comment.