Skip to content

Commit d4b3913

Browse files
authored
Support 8.2 (#31)
1 parent b6d840b commit d4b3913

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"require": {
1212
"packaged/helpers": "^1.0||^2.0",
13-
"packaged/http": "~1.1",
13+
"packaged/http": "~1.1|^2.0.0",
1414
"packaged/config": "~1.4",
1515
"tedivm/jshrink": "~1.3"
1616
},

src/Dispatch.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use Packaged\Dispatch\Resources\ResourceFactory;
1111
use Packaged\Helpers\BitWise;
1212
use Packaged\Helpers\Path;
13+
use Packaged\Http\Response;
1314
use RuntimeException;
1415
use Symfony\Component\HttpFoundation\Request;
15-
use Symfony\Component\HttpFoundation\Response;
1616
use function array_filter;
1717
use function array_shift;
1818
use function base_convert;
@@ -47,7 +47,7 @@ class Dispatch
4747
* @var ResourceStore
4848
*/
4949
protected $_resourceStore;
50-
protected $_baseUri;
50+
protected $_baseUri = "";
5151
protected $_requireFileHash = false;
5252
/**
5353
* @var ConfigProvider
@@ -107,7 +107,6 @@ public static function destroy()
107107
/**
108108
* Add salt to dispatch hashes, for additional resource security
109109
*
110-
*
111110
* @param string $hashSalt
112111
*
113112
* @return $this
@@ -206,7 +205,7 @@ public function getComponentAliases()
206205
*/
207206
public function handleRequest(Request $request): Response
208207
{
209-
$path = urldecode(substr($request->getPathInfo(), strlen(Request::create($this->_baseUri)->getPathInfo())));
208+
$path = urldecode(substr($request->getPathInfo(), strlen(Request::create($this->_baseUri ?? "")->getPathInfo())));
210209
$pathParts = array_filter(explode('/', $path));
211210
$type = array_shift($pathParts);
212211
switch($type)

0 commit comments

Comments
 (0)