diff --git a/composer.json b/composer.json index b570b19..d1b493d 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "require": { "packaged/helpers": "^1.0||^2.0", - "packaged/http": "~1.1", + "packaged/http": "~1.1|^2.0.0", "packaged/config": "~1.4", "tedivm/jshrink": "~1.3" }, diff --git a/src/Dispatch.php b/src/Dispatch.php index 997bea4..837fc1e 100644 --- a/src/Dispatch.php +++ b/src/Dispatch.php @@ -10,9 +10,9 @@ use Packaged\Dispatch\Resources\ResourceFactory; use Packaged\Helpers\BitWise; use Packaged\Helpers\Path; +use Packaged\Http\Response; use RuntimeException; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use function array_filter; use function array_shift; use function base_convert; @@ -47,7 +47,7 @@ class Dispatch * @var ResourceStore */ protected $_resourceStore; - protected $_baseUri; + protected $_baseUri = ""; protected $_requireFileHash = false; /** * @var ConfigProvider @@ -107,7 +107,6 @@ public static function destroy() /** * Add salt to dispatch hashes, for additional resource security * - * * @param string $hashSalt * * @return $this @@ -206,7 +205,7 @@ public function getComponentAliases() */ public function handleRequest(Request $request): Response { - $path = urldecode(substr($request->getPathInfo(), strlen(Request::create($this->_baseUri)->getPathInfo()))); + $path = urldecode(substr($request->getPathInfo(), strlen(Request::create($this->_baseUri ?? "")->getPathInfo()))); $pathParts = array_filter(explode('/', $path)); $type = array_shift($pathParts); switch($type)