File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,8 +312,20 @@ private function initExceptionListener()
312312 });
313313 }
314314
315+ #[Route('/dav.php/{path?} ' , name: 'dav-old ' , requirements: ['path ' => '.* ' ])]
316+ public function davLegacy (Request $ request , ?string $ path ): Response
317+ {
318+ return $ this ->redirect ($ this ->generateUrl ('dav ' , ['path ' => $ path ?? '' ]).$ this ->buildQueryString ($ request ), 301 );
319+ }
320+
321+ private function buildQueryString (Request $ request ): string
322+ {
323+ $ qs = $ request ->getQueryString ();
324+
325+ return $ qs ? '? ' .$ qs : '' ;
326+ }
327+
315328 #[Route('/dav/{path} ' , name: 'dav ' , requirements: ['path ' => '.* ' ])]
316- #[Route('/dav.php/{path} ' , name: 'dav-old ' , requirements: ['path ' => '.* ' ])]
317329 public function dav (Request $ request , ?string $ path , ?Profiler $ profiler = null )
318330 {
319331 // We don't want the toolbar on the /dav/* routes
You can’t perform that action at this time.
0 commit comments