client-python icon indicating copy to clipboard operation
client-python copied to clipboard

RESTClient handles base parameter incorrectly

Open stepancheg opened this issue 5 months ago • 1 comments

With code like this:

RESTClient(base = "http://my-local-polygon-proxy")

streaming API does not work correctly.

On this line:

https://github.com/polygon-io/client-python/blob/f789d2905bf9410ce372ff8c3dd8549534c4603d/polygon/rest/base.py#L231

Next URL tries to replace in returneded URL, that is https://api.polygon.com the substring BASE that is http://my-local-polygon-proxy, and it results in incorrect URL.

Instead, this code should just scheme and hostname.

stepancheg avatar Jun 06 '25 18:06 stepancheg