From 91c408fb4ff5a852ff48ae4d9f6b95571818f928 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 28 Jun 2020 00:50:28 +0100 Subject: [PATCH] Trim config results to prevent error in case of extra spaces --- app/UUID/UUID.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/UUID/UUID.php b/app/UUID/UUID.php index 815d958..f0ca005 100644 --- a/app/UUID/UUID.php +++ b/app/UUID/UUID.php @@ -19,7 +19,7 @@ class UUID throw new \LogicException('Argument username for ' . __METHOD__ . ' cannot be null!'); } - $response = json_decode(Http::post(config('general.urls.mojang.api') . '/profiles/minecraft', [ + $response = json_decode(Http::post(trim(config('general.urls.mojang.api')) . '/profiles/minecraft', [ $username ])->body(), true); @@ -38,7 +38,7 @@ class UUID $shortUUID = substr($uuid, 0, 8); $username = Cache::remember('uuid_' . $shortUUID, now()->addDays(30), function() use ($shortUUID, $uuid) { - $response = json_decode(Http::get(config('general.urls.mojang.session') . '/session/minecraft/profile/' . $uuid)->body(), true); + $response = json_decode(Http::get(trim(config('general.urls.mojang.session')) . '/session/minecraft/profile/' . $uuid)->body(), true); Log::debug('Caching ' . $shortUUID . 'for thirty days'); return $response['name'];