PostHog / posthog-go

Official PostHog Go library
MIT License
20 stars 17 forks source link

extra validations when specifying custom endpoint #8

Open dselans opened 2 years ago

dselans commented 2 years ago

Had issues posting to a self-hosted instance of posthog. Realized that this was because the library expects me to provide just the address (as in https://host.name.com) whereas I was providing https://host.name.com/capture.

This PR adds some extra validations for the expected endpoint config.

Sidenote: for those who have kong in front of posthog, make sure to add routes for both /capture and /batch - this library uses /batch :)