Skip to content

Commit 897da9c

Browse files
committed
update the access to Request Url
1 parent ef2b2fb commit 897da9c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/Endpoint/Binder/ModelBinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function bind(BindingContext $bindingContext)
1919

2020
if (class_exists($type)) {
2121
$model = new $type();
22-
$query = $bindingContext->ActionContext->HttpContext->Request->Query;
22+
$query = $bindingContext->ActionContext->HttpContext->Request->Url->Query;
2323
foreach ($query as $name => $value) {
2424
if (property_exists($model, $name)) {
2525
$method = new ReflectionProperty($model, $name);

lib/Endpoint/Results/RedirectResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function __construct(string $path, int $statusCode = 302)
2424
public function __invoke(ActionContext $actionContext): Task
2525
{
2626
$httpContext = $actionContext->HttpContext;
27-
$scheme = $httpContext->Request->Scheme;
28-
$host = $httpContext->Request->Host;
27+
$scheme = $httpContext->Request->Url->Scheme;
28+
$host = $httpContext->Request->Url->Host;
2929

3030
if (strpos($this->path, "/") !== 0) {
3131
$this->path = "/{$this->path}";

lib/Middlewares/ExceptionHandlerMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function async_invoke(HttpContext $context, RequestDelegate $next): void
5353
// Store the error to be handled later by the custom handler.
5454
$context->Items->add('ErrorException', $error);
5555
// Change the path to the custom handler
56-
$context->Request->Path = $this->errorHandlingPath;
56+
$context->Request->Url->Path = $this->errorHandlingPath;
5757
await($next($context));
5858
return;
5959
}

lib/Middlewares/RouterMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RouterMiddleware implements IMiddleware
2020
{
2121
public function __invoke(HttpContext $context, RequestDelegate $next)
2222
{
23-
$urlPath = $context->Request->Path;
23+
$urlPath = $context->Request->Url->path;
2424
$trimmedPath = $this->trimDuplicateSlashes($urlPath);
2525

2626
if ($trimmedPath) {

lib/Routing/RouteContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(HttpContext $httpContext)
2525
{
2626
$this->httpContext = $httpContext;
2727
$this->httpMethod = $httpContext->Request->Method;
28-
$this->urlPath = $httpContext->Request->Path;
28+
$this->urlPath = $httpContext->Request->Url->Path;
2929
$this->routeData = new RouteData();
3030
$this->Handler = null;
3131
}

0 commit comments

Comments
 (0)