11<?php
22namespace OCA \Solid \Controller ;
33
4- use OCA \Solid \DpopFactoryTrait ;
54use OCA \Solid \BearerFactoryTrait ;
6- use OCA \Solid \PlainResponse ;
5+ use OCA \Solid \DpopFactoryTrait ;
76use OCA \Solid \Notifications \SolidNotifications ;
7+ use OCA \Solid \PlainResponse ;
88
99use OCP \AppFramework \Controller ;
1010use OCP \AppFramework \Http ;
11+ use OCP \AppFramework \Http \EmptyContentSecurityPolicy ;
1112use OCP \Files \IRootFolder ;
1213use OCP \IConfig ;
1314use OCP \IDBConnection ;
1617use OCP \IURLGenerator ;
1718use OCP \IUserManager ;
1819
19- use OCP \AppFramework \Http \EmptyContentSecurityPolicy ;
20-
2120use Pdsinterop \Solid \Auth \WAC ;
2221use Pdsinterop \Solid \Resources \Server as ResourceServer ;
2322
@@ -80,7 +79,7 @@ private function getFileSystem() {
8079 $ filesystem = new \League \Flysystem \Filesystem ($ rdfAdapter );
8180
8281 $ filesystem ->addPlugin (new \Pdsinterop \Rdf \Flysystem \Plugin \AsMime ($ formats ));
83-
82+
8483 $ plugin = new \Pdsinterop \Rdf \Flysystem \Plugin \ReadRdf ($ graph );
8584 $ filesystem ->addPlugin ($ plugin );
8685
@@ -307,7 +306,7 @@ public function handleRequest($userId, $path) {
307306 $ this ->WAC = new WAC ($ this ->filesystem );
308307
309308 $ request = $ this ->rawRequest ;
310- $ baseUrl = $ this ->getStorageUrl ($ userId );
309+ $ baseUrl = $ this ->getStorageUrl ($ userId );
311310 $ this ->resourceServer ->setBaseUrl ($ baseUrl );
312311 $ this ->WAC ->setBaseUrl ($ baseUrl );
313312
@@ -355,20 +354,20 @@ public function handleRequest($userId, $path) {
355354 ->withStatus (403 , "Access denied " );
356355 return $ this ->respond ($ response );
357356 }
358- $ response = $ this ->resourceServer ->respondToRequest ($ request );
357+ $ response = $ this ->resourceServer ->respondToRequest ($ request );
359358 $ response = $ this ->WAC ->addWACHeaders ($ request , $ response , $ webId );
360359 return $ this ->respond ($ response );
361360 }
362-
361+
363362 /**
364363 * @PublicPage
365364 * @NoAdminRequired
366365 * @NoCSRFRequired
367366 */
368- public function handleGet ($ userId , $ path ) {
367+ public function handleGet ($ userId , $ path ) {
369368 return $ this ->handleRequest ($ userId , $ path );
370369 }
371-
370+
372371 /**
373372 * @PublicPage
374373 * @NoAdminRequired
@@ -385,15 +384,15 @@ public function handlePost($userId, $path) {
385384 public function handlePut () { // $userId, $path) {
386385 // FIXME: Adding the correct variables in the function name will make nextcloud
387386 // throw an error about accessing put twice, so we will find out the userId and path from $_SERVER instead;
388-
387+
389388 // because we got here, the request uri should look like:
390389 // /index.php/apps/solid/@{userId}/storage{path}
391390 $ pathInfo = explode ("@ " , $ _SERVER ['REQUEST_URI ' ]);
392391 $ pathInfo = explode ("/ " , $ pathInfo [1 ], 2 );
393392 $ userId = $ pathInfo [0 ];
394393 $ path = $ pathInfo [1 ];
395394 $ path = preg_replace ("/^storage/ " , "" , $ path );
396-
395+
397396 return $ this ->handleRequest ($ userId , $ path );
398397 }
399398 /**
@@ -438,7 +437,7 @@ private function respond($response) {
438437// $result->addHeader('Access-Control-Allow-Credentials', 'true');
439438// $result->addHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
440439// $result->addHeader('Access-Control-Allow-Origin', $origin);
441-
440+
442441 $ policy = new EmptyContentSecurityPolicy ();
443442 $ policy ->addAllowedStyleDomain ("* " );
444443 $ policy ->addAllowedStyleDomain ("data: " );
0 commit comments