diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -69,13 +69,18 @@ // repository has a different canonical path like "/diffusion/XYZ/...", // redirect them to the canonical path. - $request_path = $request->getPath(); - $repository = $drequest->getRepository(); + // Skip this redirect if the request is an AJAX request, like the requests + // that Owners makes to complete and validate paths. + + if (!$request->isAjax()) { + $request_path = $request->getPath(); + $repository = $drequest->getRepository(); - $canonical_path = $repository->getCanonicalPath($request_path); - if ($canonical_path !== null) { - if ($canonical_path != $request_path) { - return id(new AphrontRedirectResponse())->setURI($canonical_path); + $canonical_path = $repository->getCanonicalPath($request_path); + if ($canonical_path !== null) { + if ($canonical_path != $request_path) { + return id(new AphrontRedirectResponse())->setURI($canonical_path); + } } }