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

@ -33,6 +33,7 @@ use Friendica\Model\Storage\ExternalResource;
use Friendica\Model\Storage\SystemResource;
use Friendica\Model\User;
use Friendica\Network\HTTPException;
use Friendica\Network\HTTPException\NotModifiedException;
use Friendica\Object\Image;
use Friendica\Util\Images;
use Friendica\Util\Network;
@ -55,7 +56,6 @@ class Photo extends BaseModule
$totalstamp = microtime(true);
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"]);
@ -67,7 +67,7 @@ class Photo extends BaseModule
header_remove("Expires");
header_remove("Cache-Control");
}
exit;
throw new NotModifiedException();
}
Profile::addVisitorCookieForHTTPSigner();