PostHog / posthog-php

MIT License
18 stars 19 forks source link

Allow hosts with protocol specified #19

Closed yakkomajuri closed 3 years ago

yakkomajuri commented 3 years ago

Currently we don't accept hosts like https://app.posthog.com/, we expect the domain only.

imhmdb commented 3 years ago

hi @yakkomajuri, I think we need to change this: https://github.com/PostHog/posthog-php/blob/b9dd0931e54e983e543cd0c75f848f4195d6b14d/lib/HttpClient.php#L125 into:

            $handler = $this->errorHandler;
            $handler($code, $message);

to resolve the Call to undefined method PostHog\HttpClient::errorHandler() in /app/lib/HttpClient.php:125 error raised in the CI

reference: https://stackoverflow.com/a/12196565

yakkomajuri commented 3 years ago

That might need updating too, but the fails here were related to how I was passing the host down

imhmdb commented 3 years ago

That might need updating too, but the fails here were related to how I was passing the host down

:+1:

I opened a pr for it: https://github.com/PostHog/posthog-php/pull/20