Skip to content

Commit 81566fa

Browse files
authored
Merge pull request #585 from bakaphp/fix-uri-decode
[0.2] Decode the request URI before the application handle
2 parents e9eb564 + 52cf976 commit 81566fa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Bootstrap/Api.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
use function Baka\appPath;
88
use Baka\Http\Request\Phalcon as Request;
9+
use Canvas\Http\Response;
910
use Phalcon\Di\FactoryDefault;
1011
use Phalcon\Mvc\Micro;
11-
use Canvas\Http\Response;
1212
use Throwable;
1313

1414
/**
@@ -29,7 +29,8 @@ public function run()
2929
{
3030
try {
3131
$request = new Request();
32-
return $this->application->handle($request->getServer('REQUEST_URI'));
32+
$uri = rawurldecode($request->getServer('REQUEST_URI'));
33+
return $this->application->handle($uri);
3334
} catch (Throwable $e) {
3435
$response = new Response();
3536
$response->handleException($e)->send();
@@ -46,8 +47,8 @@ public function setup()
4647
//set all the services
4748

4849
/**
49-
* @todo Find a better way to handle unit test file include
50-
*/
50+
* @todo Find a better way to handle unit test file include
51+
*/
5152
$this->providers = require appPath('api/config/providers.php');
5253

5354
//run my parents setup

0 commit comments

Comments
 (0)