Skip to content

Commit

Permalink
Bugfix : remove trailing '/' in api url.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Sep 16, 2024
1 parent 8f49fba commit deabe0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Helpers/AdversaryMeter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;

/** @deprecated */
class AdversaryMeter
Expand All @@ -12,6 +13,9 @@ public static function redirectUrl()
{
$apiToken = self::findAnyAdversaryMeterApiToken(Auth::user()); // TODO : throw an error if not set ?
$apiUrl = config('app.url');
if (Str::endsWith($apiUrl, '/')) {
$apiUrl = Str::beforeLast($apiUrl, '/');
}
return asset('adversary_meter') . "/src/index.html?api_token={$apiToken}&api_url={$apiUrl}";
}

Expand Down

0 comments on commit deabe0c

Please sign in to comment.