Improved http error handling

This commit is contained in:
Michael 2021-10-29 23:21:07 +00:00
parent b2165cdf22
commit 4236a9a105
55 changed files with 282 additions and 135 deletions

View file

@ -25,6 +25,7 @@ use Friendica\BaseModule;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Network\HTTPException\NotModifiedException;
use Friendica\Object\Image;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Images;
@ -53,7 +54,6 @@ class Proxy extends BaseModule
}
if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) {
header("HTTP/1.1 304 Not Modified");
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
if (!empty($_SERVER["HTTP_IF_NONE_MATCH"])) {
header("Etag: " . $_SERVER["HTTP_IF_NONE_MATCH"]);
@ -65,7 +65,7 @@ class Proxy extends BaseModule
header_remove("Expires");
header_remove("Cache-Control");
}
exit;
throw new NotModifiedException();
}
if (empty($request['url'])) {