Skip to content

Commit

Permalink
Allow path without .htacces by path parametr
Browse files Browse the repository at this point in the history
  • Loading branch information
honzapospi committed Oct 19, 2016
1 parent 19596ae commit f466359
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit f466359

Please sign in to comment.