Permalink
Browse files

Uses redirectexit and fixes #3798 (#3799)

* Use redirectexit instead of manually updating header

Signed-off-by: Colin Schoen <cschoen@berkeley.edu>

* More fixes

Signed-off-by: Colin Schoen <cschoen@berkeley.edu>

* Fix indentation

Signed-off-by: Colin Schoen <cschoen@berkeley.edu>
  • Loading branch information...
1 parent 6060fad commit 6812c1bffeb89bf1ad46737df98d354cb044dc50 @colinschoen colinschoen committed on GitHub Jan 6, 2017
Showing with 4 additions and 2 deletions.
  1. +4 −2 proxy.php
View
@@ -43,6 +43,8 @@ public function __construct()
require_once(dirname(__FILE__) . '/Settings.php');
require_once($sourcedir . '/Class-CurlFetchWeb.php');
+ require_once($sourcedir . '/Subs.php');
+
// Turn off all error reporting; any extra junk makes for an invalid image.
error_reporting(0);
@@ -103,12 +105,12 @@ public function serve()
@unlink($cached_file);
if ($this->checkRequest())
$this->serve();
- exit;
+ redirectexit($request);
}
// Right, image not cached? Simply redirect, then.
if (!$this->checkRequest())
- header('Location: ' . $request);
+ redirectexit($request);
// Make sure we're serving an image
$contentParts = explode('/', !empty($cached['content_type']) ? $cached['content_type'] : '');

0 comments on commit 6812c1b

Please sign in to comment.