Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rosell-dk committed Oct 2, 2019
1 parent d8a5db6 commit 707ed68
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/Serve/ServeConvertedWebP.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ private static function processOptions($options)
new BooleanOption('show-report', false),
new BooleanOption('suppress-warnings', true),
new BooleanOption('redirect-to-self-instead-of-serving', false),
//new BooleanOption('redirect-to-self-instead-of-serving-destination', false),
new ArrayOption('serve-image', []),
new SensitiveArrayOption('convert', [])
);
Expand Down Expand Up @@ -183,8 +182,12 @@ public static function serve($source, $destination, $options = [], $serveLogger
}

if ($options['redirect-to-self-instead-of-serving']) {
Header::addLogHeader('Redirecting to self! (hope you got redirection to existing webps set up, otherwise you will get a loop!)', $serveLogger);
header('Location: ?fresh' , 302);
Header::addLogHeader(
'Redirecting to self! ' .
'(hope you got redirection to existing webps set up, otherwise you will get a loop!)',
$serveLogger
);
header('Location: ?fresh', 302);
return;
}

Expand All @@ -197,14 +200,7 @@ public static function serve($source, $destination, $options = [], $serveLogger
self::serveOriginal($source, $options['serve-image']);
}

/*if ($options['redirect-to-self-instead-of-serving-destination']) {
Header::addLogHeader('Redirecting to self! (hope you got redirection to existing webps set up, otherwise you will get a loop!)', $serveLogger);
header('Location: ?fresh' , 302);
} else {*/
Header::addLogHeader('Serving converted file', $serveLogger);
self::serveDestination($destination, $options['serve-image']);
//}


Header::addLogHeader('Serving converted file', $serveLogger);
self::serveDestination($destination, $options['serve-image']);
}
}

0 comments on commit 707ed68

Please sign in to comment.