Skip to content

Commit

Permalink
fix: Correct return type for the AddTenantHeaderToResponse middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Nov 25, 2024
1 parent febbe05 commit 66098b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Http/Middleware/AddTenantHeaderToResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Sprout\Http\Resolvers\HeaderIdentityResolver;
use Sprout\Sprout;
use Sprout\Support\ResolutionHelper;
use Sprout\Support\ResolutionHook;
use Symfony\Component\HttpFoundation\Response;

/**
* Add Tenant Header to Response
Expand Down Expand Up @@ -43,9 +42,10 @@ public function __construct(Sprout $sprout)
* @param \Closure $next
* @param string ...$options
*
* @return \Illuminate\Http\Response
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Sprout\Exceptions\NoTenantFound
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @throws \Sprout\Exceptions\MisconfigurationException
*/
public function handle(Request $request, Closure $next, string ...$options): Response
{
Expand All @@ -68,7 +68,7 @@ public function handle(Request $request, Closure $next, string ...$options): Res
}

return $response->withHeaders([
$resolver->getRequestHeaderName($tenancy) => $tenancy->identifier()
$resolver->getRequestHeaderName($tenancy) => $tenancy->identifier(),
]);
}
}
2 changes: 1 addition & 1 deletion src/Http/Middleware/TenantRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(Sprout $sprout)
* @param \Closure $next
* @param string ...$options
*
* @return \Illuminate\Http\Response
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Sprout\Exceptions\NoTenantFound
* @throws \Illuminate\Contracts\Container\BindingResolutionException
Expand Down

0 comments on commit 66098b6

Please sign in to comment.