Update routes to reflect daemon changes

This commit is contained in:
Dane Everitt 2016-10-04 21:38:32 -04:00
parent 9c7b753576
commit 8330e26b39
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 6 additions and 5 deletions

View file

@ -172,11 +172,11 @@ class ServerController extends Controller
$download->token = (string) Uuid::generate(4);
$download->server = $server->uuid;
$download->path = str_replace('../', '', $file);
$download->path = $file;
$download->save();
return redirect( $node->scheme . '://' . $node->fqdn . ':' . $node->daemonListen . '/server/download/' . $download->token);
return redirect( $node->scheme . '://' . $node->fqdn . ':' . $node->daemonListen . '/server/file/download/' . $download->token);
}

View file

@ -98,7 +98,7 @@ class FileRepository
$file->dirname = (in_array($file->dirname, ['.', './', '/'])) ? null : trim($file->dirname, '/') . '/';
$res = $this->client->request('GET', '/server/files/stat/' . rawurlencode($file->dirname.$file->basename) , [
$res = $this->client->request('GET', '/server/file/stat/' . rawurlencode($file->dirname.$file->basename) , [
'headers' => $this->headers
]);
@ -115,7 +115,7 @@ class FileRepository
throw new DisplayException('That file is too large to open in the browser, consider using a SFTP client.');
}
$res = $this->client->request('GET', '/server/file/' . rawurlencode($file->dirname.$file->basename) , [
$res = $this->client->request('GET', '/server/file/f/' . rawurlencode($file->dirname.$file->basename) , [
'headers' => $this->headers
]);
@ -149,9 +149,10 @@ class FileRepository
$file->dirname = (in_array($file->dirname, ['.', './', '/'])) ? null : trim($file->dirname, '/') . '/';
$res = $this->client->request('POST', '/server/file/' . rawurlencode($file->dirname.$file->basename), [
$res = $this->client->request('POST', '/server/file/save', [
'headers' => $this->headers,
'json' => [
'path' => rawurlencode($file->dirname.$file->basename),
'content' => $content
]
]);