Redirecting not logged in user instead of failing

This commit is contained in:
Michael 2021-07-04 11:53:49 +00:00
parent da484a48e3
commit 24f013a654

View File

@ -23,6 +23,7 @@ namespace Friendica\Module;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Object\Image; use Friendica\Object\Image;
@ -47,10 +48,6 @@ class Proxy extends BaseModule
*/ */
public static function rawContent(array $parameters = []) public static function rawContent(array $parameters = [])
{ {
if (!local_user()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
// Set application instance here // Set application instance here
$a = DI::app(); $a = DI::app();
@ -93,6 +90,11 @@ class Proxy extends BaseModule
throw new \Friendica\Network\HTTPException\BadRequestException(); 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... // Webserver already tried direct cache...
// Try to use filecache; // Try to use filecache;