pusher / pusher-http-php

PHP library for interacting with the Pusher Channels HTTP API
https://pusher.com/docs/server_api_guide
1.41k stars 307 forks source link

Fix `path` option #335

Closed makstech closed 1 year ago

makstech commented 2 years ago

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

makstech commented 2 years ago

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

sondt-1245 commented 2 years ago

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

sonologico commented 1 year ago

Thank you very much!