From 366e095e202bc6586c44179b8ccbba8bf50a96c8 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 9 Dec 2019 14:23:58 +0000 Subject: [PATCH] authentication : do not display the script for JWT remove if in JSON request git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5823 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authentication.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentication.php b/authentication.php index 517ba71..219e098 100644 --- a/authentication.php +++ b/authentication.php @@ -124,7 +124,9 @@ class authentication // Unset the JSON Web Token as the authentication if ($this->route->debug) echo "Unset the JSON Web Token '$tokenName'
\n"; - echo "\n"; + if (! key_exists ("CONTENT_TYPE", $_SERVER) || + $_SERVER["CONTENT_TYPE"] !== "application/json") + echo "\n"; $algorithm = "HS256"; $cipherKey = null; $cacheDir = "data/jwtCache";