Skip to content

Commit 2220886

Browse files
committed
more bugfixes for drycoded
1 parent f6679c1 commit 2220886

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

solid/lib/Controller/SolidWebhookController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function __construct($AppName, IRootFolder $rootFolder, IRequest $request
5050

5151
$this->DPop = new DPop();
5252
try {
53-
$rawRequest = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
54-
$this->webId = $this->DPop->getWebId($rawRequest);
53+
$this->rawRequest = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
54+
$this->webId = $this->DPop->getWebId($this->rawRequest);
5555
} catch(\Exception $e) {
5656
return new PlainResponse("Invalid token", 409);
5757
}
@@ -138,9 +138,9 @@ private function parseTargetUrl($targetUrl) {
138138
$appBaseUrl = $this->getAppBaseUrl(); // https://nextcloud.server/solid/
139139
$internalUrl = str_replace($appBaseUrl, '', $targetUrl); // @alice/storage/foo/bar
140140
$pathicles = explode("/", $internalUrl);
141-
$userId = $pathicles[0]; // alice
142-
143-
$storageUrl = $this->getStorageUrl($userId); // https://nextcloud.server/solid/@alice/storage/
141+
$userId = $pathicles[0]; // @alice
142+
$userId = preg_replace("/^@/", "", $userId); // alice
143+
$storageUrl = $this->getStorageUrl($userId); // https://nextcloud.server/solid/@alice/storage/
144144
$storagePath = str_replace($storageUrl, '/', $targetUrl); // /foo/bar
145145
return array(
146146
"userId" => $userId,

0 commit comments

Comments
 (0)