Skip to content

Commit

Permalink
Add header X-Powered-By
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna authored and f3l1x committed Feb 8, 2025
1 parent a8f30bb commit 3dda88a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Api/GoSmsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
final class GoSmsApi
{

private const BASE_MESSAGE_URL = Config::BASE_URL . '/messages';
private const BASE_MESSAGE_URL = Config::URL_API . '/messages';

public function __construct(
private IAccessTokenProvider $accessTokenProvider,
Expand Down Expand Up @@ -51,7 +51,7 @@ public function messageDelete(Config $config, string $id): stdClass

public function accountDetail(Config $config): stdClass
{
return $this->client->json(Config::BASE_URL . '/', $this->getAccessToken($config));
return $this->client->json(Config::URL_API . '/', $this->getAccessToken($config));
}

private function getAccessToken(Config $config): string
Expand Down
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ final class Config
{

public const URL = 'https://app.gosms.cz';
public const BASE_URL = self::URL . '/api/v1';
public const URL_API = self::URL . '/api/v1';

public function __construct(private string $clientId, private string $clientSecret)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function json(
): stdClass
{
$request = $this->createRequest($uri, $accessToken, $method, $body);
$response = $this->client->sendRequest($request);
$response = $this->client->sendRequest($request->withHeader('X-Powered-By', 'contributte/gosms'));

return $this->decodeResponse($response, $code);
}
Expand Down

0 comments on commit 3dda88a

Please sign in to comment.