diff --git a/public/API/graphql.php b/public/API/graphql.php index b778f21..84ee939 100644 --- a/public/API/graphql.php +++ b/public/API/graphql.php @@ -1,6 +1,7 @@ $schema, 'rootValue' => [ 'db' =>$conn, - ] + ], + 'debugFlag' => DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE, ]; $server = new StandardServer($serverConfig); diff --git a/public/API/queries/skills.php b/public/API/queries/skills.php index 93b00de..a9b9f47 100644 --- a/public/API/queries/skills.php +++ b/public/API/queries/skills.php @@ -28,7 +28,11 @@ function getSkills() { // Get the actual presigned-url $downloadURL = (string) $presignedRequest->getUri(); - array_push($response, $downloadURL); + $encodedUrl = rtrim(strtr(base64_encode($downloadURL), '+/', '-_'), '='); + $path = "/rs:fit:0:80:1/g:no/{$encodedUrl}.png"; + + $signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '='); + array_push($response, $imgProxyUrl . "/" . $signature . $path); } return $response; }