pusher-http-php icon indicating copy to clipboard operation
pusher-http-php copied to clipboard

Fix `path` option

Open makstech opened this issue 2 years ago • 2 comments

Description

Pusher class allows setting path option, which later is used in Pusher::channels_url_prefix to create a base_uri for the Guzzle client. But at the moment, it doesn't work because in the constructor, the base_path setting is set with a leading slash which means that the path in base_uri will be overwritten and unused (source).

It needs to be working because otherwise, it's impossible to use with a server behind a proxy under "subdirectory".
E.g. Nginx configuration

location /pusher {
    proxy_pass http://example:6001/
    ...
}

For this to work, leading slashes from the path had to be removed in all calls to Guzzle.

CHANGELOG

  • [FIXED] path option can be used for proxied servers under "subdirectory".
  • [CHANGED] base_path's leading slash is trimmed on every call to Guzzle.

makstech avatar Jun 15 '22 20:06 makstech

@benjamin-tang-pusher Sorry for tagging you but this PR has been open for more than a month. Could you please check this?

makstech avatar Jul 27 '22 07:07 makstech

@benjamin-tang-pusher I got this problem too, could you please check it soon ?

sondt-1245 avatar Jul 29 '22 08:07 sondt-1245

Thank you very much!

sonologico avatar Sep 29 '22 13:09 sonologico