Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Middleware/ErrorRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function handle(
$errorCode = $this->throwable->getHttpCode();
}

$this->originalUri = $request->getUri();
$errorUri = new Uri("/_$errorCode");
$errorRequest = $request->withUri($errorUri);

Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Gt\Http\Response;
use Gt\Http\ServerInfo;
use Gt\Http\StatusCode;
use Gt\Http\Uri;
use Gt\Input\Input;
use Gt\Input\InputData\InputData;
use Gt\Logger\LogConfig;
Expand Down Expand Up @@ -49,6 +50,7 @@ class RequestHandler implements RequestHandlerInterface {
protected DynamicPath $dynamicPath;
protected HTMLDocument/*|NullViewModel*/ $viewModel;
protected BaseView $view;
protected Uri $originalUri;

public function __construct(
protected readonly Config $config,
Expand Down Expand Up @@ -89,6 +91,7 @@ public function getServiceContainer():Container {
public function handle(
ServerRequestInterface $request
):ResponseInterface {
$this->originalUri = $request->getUri();
$this->completeRequestHandling($request);
return $this->response;
}
Expand Down Expand Up @@ -151,7 +154,7 @@ protected function handleRouting(ServerRequestInterface $request) {
$this->logicAssembly = $router->getLogicAssembly();

$this->dynamicPath = new DynamicPath(
$request->getUri()->getPath(),
$this->originalUri->getPath(),
$this->viewAssembly,
$this->logicAssembly,
);
Expand Down