Skip to content

Commit

Permalink
hide X-Powered-By header on production mode Luracast#514
Browse files Browse the repository at this point in the history
  • Loading branch information
João Pina committed Apr 19, 2016
1 parent 442409f commit 556e059
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion vendor/Luracast/Restler/PassThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public static function file($filename, $forceDownload = false, $expires = 0, $is
exit;
}
header('Last-Modified: ' . date('r', $lastModified));
header('X-Powered-By: Luracast Restler v' . Restler::VERSION);

if (!Scope::get('Restler')->getProductionMode()) {
header('X-Powered-By: Luracast Restler v' . Restler::VERSION);
}

header('Content-type: ' . $mime);
header("Content-Length: " . filesize($filename));
if ($forceDownload) {
Expand Down
5 changes: 4 additions & 1 deletion vendor/Luracast/Restler/Restler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,10 @@ public function composeHeaders(RestException $e = null)
}
@header('Cache-Control: ' . $cacheControl);
@header('Expires: ' . $expires);
@header('X-Powered-By: Luracast Restler v' . Restler::VERSION);

if (!$this->productionMode) {
@header('X-Powered-By: Luracast Restler v' . Restler::VERSION);
}

if (Defaults::$crossOriginResourceSharing
&& isset($_SERVER['HTTP_ORIGIN'])
Expand Down

0 comments on commit 556e059

Please sign in to comment.