- 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"]);
+ $request = $this->getRequestInfo();
+
+ if (!DI::config()->get('system', 'proxify_content')) {
+ Logger::notice('Proxy access is forbidden', ['request' => $request, 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'accept' => $_SERVER['HTTP_ACCEPT'] ?? '']);
+ throw new \Friendica\Network\HTTPException\NotFoundException();
+ }
+
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+ 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']);