mirror of
https://github.com/friendica/friendica
synced 2024-11-19 01:03:40 +00:00
Merge pull request #10463 from annando/proxy-security
Proxy: Avoid access for not logged in users
This commit is contained in:
commit
bedc8e1427
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
@ -45,7 +46,7 @@ class Proxy extends BaseModule
|
|||
* Sets application instance and checks if /proxy/ path is writable.
|
||||
*
|
||||
*/
|
||||
public static function init(array $parameters = [])
|
||||
public static function rawContent(array $parameters = [])
|
||||
{
|
||||
// Set application instance here
|
||||
$a = DI::app();
|
||||
|
@ -89,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;
|
||||
|
|
Loading…
Reference in a new issue