From f4663599f39ef4fc4ee17d952d1807cf19034c92 Mon Sep 17 00:00:00 2001 From: honzapospi Date: Wed, 19 Oct 2016 16:48:55 +0200 Subject: [PATCH] Allow path without .htacces by path parametr --- src/Application.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Application.php b/src/Application.php index f6dc314..7c026a8 100644 --- a/src/Application.php +++ b/src/Application.php @@ -55,6 +55,9 @@ public function __construct(IRouteListFactory $routeListFactory, Request $reques public function run(){ try { $path = substr($this->request->url->path, strlen($this->request->url->basePath) - 1); + // accept /?path=/endpoint AND index.php?path=/endpoint + if($path == '/' || $path == '/index.php' && $this->request->getQuery('path')) + $path = $this->request->getQuery('path'); $routeResponse = $this->routeList->match($path, $this->request->method); if(!$routeResponse) throw new BadRequestException('Unsupported '.$this->request->method.' request');