Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong uri for RestApi requests in Pusher.php #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Pusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(string $auth_key, string $secret, string $app_id, ar
$this->settings['auth_key'] = $auth_key;
$this->settings['secret'] = $secret;
$this->settings['app_id'] = $app_id;
$this->settings['base_path'] = '/apps/' . $this->settings['app_id'];
$this->settings['base_path'] = (isset($options['path']) ? $options['path'] : '') . '/apps/' . $this->settings['app_id'];

foreach ($options as $key => $value) {
// only set if valid setting/option
Expand Down Expand Up @@ -217,7 +217,7 @@ private function validate_channel(string $channel): void
*
* @throws PusherException If $socket_id is invalid
*/
private function validate_socket_id(string $socket_id): void
protected function validate_socket_id(string $socket_id): void
{
if ($socket_id !== null && !preg_match('/\A\d+\.\d+\z/', $socket_id)) {
throw new PusherException('Invalid socket ID ' . $socket_id);
Expand Down Expand Up @@ -265,7 +265,7 @@ private function sign(string $path, string $request_method = 'GET', array $query
*/
private function channels_url_prefix(): string
{
return $this->settings['scheme'] . '://' . $this->settings['host'] . ':' . $this->settings['port'] . $this->settings['path'];
return $this->settings['scheme'] . '://' . $this->settings['host'] . ':' . $this->settings['port'];
}

/**
Expand Down