Project

General

Profile

Actions

Anomalie #17480

open

Redirection en boucle car mauvaise gestion d’erreur

Added by Quentin RIBAC over 3 years ago. Updated 3 months ago.

Status:
R&D - A étudier
Priority:
2-Sérieux
Assignee:
-
Target version:
-
Start date:
06/17/2021
Due date:

Description

Maarch Courrier develop & 21.03

Si le fichier de configuration config.json est introuvable, ou illisible pour des problèmes de droits, l’API devrait renvoyer un message d’erreur clair, or ce n’est pas toujours le cas.

Dans le cas où l’application est installée dans un dossier, par exemple /var/www/html/MaarchCourrier/, et que custom/custom.json contient :

{
  [
    "id": "nom_client",
    "uri": null,
    "path": "MaarchCourrier"
  ]
}

Dans ce cas précis on obtient une redirection en boucle, vers https://mon-serveur.fr/MaarchCourrier/MaarchCourrier/MaarchCourrier/...

Il serait utile de corriger ce problème afin de permettre aux intégrateurs de mieux diagnostiquer les erreurs.

Correction possible :

diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php
index fe63275807..3445b055bb 100755
--- a/src/core/controllers/AuthenticationController.php
+++ b/src/core/controllers/AuthenticationController.php
@@ -116,7 +116,11 @@ class AuthenticationController
         $url = null;
         if (!empty($jsonFile[0]['path'])) {
             $coreUrl = UrlController::getCoreUrl();
-            $url = $coreUrl . $jsonFile[0]['path'] . "/dist/index.html";
+            $url = rtrim($coreUrl, '/').'/';
+            if (basename($coreUrl) != trim($jsonFile[0]['path'], '/')) {
+                $url .= trim($jsonFile[0]['path'], '/').'/';
+            }
+            $url .= 'dist/index.html';
         } elseif (!empty($jsonFile[0]['uri'])) {
             $url = $jsonFile[0]['uri'] . "/dist/index.html";
         }

Ici on n’ajouterait la variable path du custom seulement si elle est différente du chemin de la racine de l’application, évitant ainsi de rediriger vers /MaarchCourrier/MaarchCourrier/.

Actions #1

Updated by Emmanuel DILLARD over 3 years ago

  • Due date set to 06/21/2021
  • Status changed from A traiter to Etude planifiée
  • Target version set to 21.03
Actions #2

Updated by Emmanuel DILLARD over 3 years ago

  • Due date deleted (06/21/2021)
  • Status changed from Etude planifiée to R&D - A planifier
  • Assignee set to EDI PO
Actions #3

Updated by Emmanuel DILLARD over 3 years ago

  • Assignee deleted (EDI PO)
Actions #4

Updated by Emmanuel DILLARD over 1 year ago

  • Status changed from R&D - A planifier to R&D - A étudier
Actions #5

Updated by Emmanuel DILLARD about 1 year ago

  • Version source set to 2301
Actions #6

Updated by Emmanuel DILLARD 5 months ago

  • Target version changed from 21.03 to Inscription Backlog
Actions #7

Updated by Emmanuel DILLARD 3 months ago

  • Target version deleted (Inscription Backlog)
Actions

Also available in: Atom PDF