From b0de4841f63ba5425182b39ab05625240340ef4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Mon, 29 Sep 2025 14:54:31 +0200 Subject: [PATCH] Fix FLEXIAPI-395 Remove config()->set('app.sip_domain') and directly use the correct domain --- CHANGELOG.md | 1 + flexiapi/tests/Feature/ApiSpaceWithMiddlewareTest.php | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 753aed6..80aa6f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ v2.1 - Fix FLEXIAPI-385 Use domains and not hosts in the EmailServer endpoints as defined in the API documentation - Fix FLEXIAPI-391 Add missing account view attribute in the actions.delete view - Fix FLEXIAPI-392 Fix the recover_by_code view and use the account space object +- Fix FLEXIAPI-395 Remove config()->set('app.sip_domain') and directly use the correct domain v2.0 ---- diff --git a/flexiapi/tests/Feature/ApiSpaceWithMiddlewareTest.php b/flexiapi/tests/Feature/ApiSpaceWithMiddlewareTest.php index e159a5d..b337a63 100644 --- a/flexiapi/tests/Feature/ApiSpaceWithMiddlewareTest.php +++ b/flexiapi/tests/Feature/ApiSpaceWithMiddlewareTest.php @@ -42,7 +42,6 @@ class ApiSpaceWithMiddlewareTest extends TestCase // Try to create a new user as an admin $admin->generateUserApiKey(); - config()->set('app.sip_domain', $space->domain); $this->keyAuthenticated($admin) ->json($this->method, 'http://' . $admin->domain . $this->accountRoute, [ @@ -52,20 +51,19 @@ class ApiSpaceWithMiddlewareTest extends TestCase ])->assertStatus(403); // Unexpire the space and try again - config()->set('app.sip_domain', $superAdmin->domain); $space = $this->keyAuthenticated($superAdmin) - ->get($this->route . '/' . $admin->domain) + ->get('http://' . $superAdmin->domain . $this->route . '/' . $admin->domain) ->json(); $space['expire_at'] = Carbon::tomorrow()->toDateTimeString(); $this->keyAuthenticated($superAdmin) - ->json('PUT', $this->route . '/' . $admin->domain, $space) + ->json('PUT', 'http://' . $superAdmin->domain . $this->route . '/' . $admin->domain, $space) ->assertStatus(200); $this->keyAuthenticated($superAdmin) - ->json($this->method, $this->accountRoute, [ + ->json($this->method, 'http://' . $admin->domain . $this->accountRoute, [ 'username' => 'new', 'algorithm' => 'SHA-256', 'password' => '123456',