Update demon routes to use /v1/

This commit is contained in:
Dane Everitt 2017-09-30 21:00:24 -05:00
parent 15d38ce823
commit b1834307d5
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
25 changed files with 55 additions and 67 deletions

View file

@ -30,6 +30,8 @@ use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Testing\HttpException;
use League\Fractal\Serializer\JsonApiSerializer;
use Pterodactyl\Transformers\Daemon\ApiKeyTransformer;
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface;
class ValidateKeyController extends Controller
@ -81,7 +83,11 @@ class ValidateKeyController extends Controller
throw new HttpException(501);
}
$key = $this->daemonKeyRepository->getKeyWithServer($token);
try {
$key = $this->daemonKeyRepository->getKeyWithServer($token);
} catch (RecordNotFoundException $exception) {
throw new NotFoundHttpException;
}
return $this->fractal->item($key, $this->app->make(ApiKeyTransformer::class), 'server')
->serializeWith(JsonApiSerializer::class)

View file

@ -194,7 +194,6 @@ class OptionController extends Controller
$this->optionUpdateService->handle($option, $request->all());
$this->alert->success(trans('admin/services.options.notices.option_updated'))->flash();
} catch (NoParentConfigurationFoundException $exception) {
dd('hodor');
$this->alert->danger($exception->getMessage())->flash();
}

View file

@ -55,7 +55,7 @@ class DownloadController extends Controller
$this->cache->tags(['Server:Downloads'])->put($token, ['server' => $server->uuid, 'path' => $file], 5);
return redirect(sprintf(
'%s://%s:%s/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, $token
'%s://%s:%s/v1/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, $token
));
}
}