]> git.mxchange.org Git - friendica.git/commitdiff
Redirecting not logged in user instead of failing
authorMichael <heluecht@pirati.ca>
Sun, 4 Jul 2021 11:53:49 +0000 (11:53 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 4 Jul 2021 11:53:49 +0000 (11:53 +0000)
src/Module/Proxy.php

index 57ff59256460d4cf73cd73ee6ff73d018e582e7e..317ec530a5335ab22dc9024182087ba21de09dc4 100644 (file)
@@ -23,6 +23,7 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Core\Logger;
+use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Photo;
 use Friendica\Object\Image;
@@ -47,10 +48,6 @@ class Proxy extends BaseModule
         */
        public static function rawContent(array $parameters = [])
        {
-               if (!local_user()) {
-                       throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
-               }
-
                // Set application instance here
                $a = DI::app();
 
@@ -93,6 +90,11 @@ class Proxy extends BaseModule
                        throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
+               if (!local_user()) {
+                       Logger::info('Redirecting not logged in user to original address', ['url' => $request['url']]);
+                       System::externalRedirect($request['url']);
+               }
+
                // Webserver already tried direct cache...
 
                // Try to use filecache;