mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
add extra $path validation to TenantAssetsController
This commit is contained in:
parent
395192442d
commit
4af70d302f
3 changed files with 31 additions and 1 deletions
|
|
@ -141,4 +141,17 @@ class TenantAssetTest extends TestCase
|
|||
$response->assertNotFound();
|
||||
}
|
||||
|
||||
public function test_asset_controller_returns_a_403_when_an_invalid_path_is_provided()
|
||||
{
|
||||
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByRequestData::class;
|
||||
|
||||
$tenant = Tenant::create();
|
||||
|
||||
tenancy()->initialize($tenant);
|
||||
$response = $this->get(tenant_asset('../foo.txt'), [
|
||||
'X-Tenant' => $tenant->id,
|
||||
]);
|
||||
|
||||
$response->assertForbidden();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue