## Is your feature request related to a problem?

When sending incorrectly formatted payloads (e.g. a text-based string with a `gzip` compression header), the app will fail with a cryptic 500 error and register an unhandled exception.

## Describe the solution you'd like
The app should return a 400 bad request error, with details on why the request failed (i.e. it is incorrectly formatted or the content does not match the compression specified). In addition, this shouldn't be treated as an unhandled exception as it's a client error.


## Describe alternatives you've considered
Keep returning a cryptic 500 error.


## Additional context
Relevant context on #2701


#### *Thank you* for your feature request – we love each and every one!

posthog/utils.py
github: bool = bool(settings.SOCIAL_AUTH_GITHUB_KEY and settings.SOCIAL_AUTH_GITHUB_SECRET)
    gitlab: bool = bool(settings.SOCIAL_AUTH_GITLAB_KEY and settings.SOCIAL_AUTH_GITLAB_SECRET)
    google: bool = False
    if getattr(settings, "SOCIAL_AUTH_GOOGLE_OAUTH2_KEY", None) and getattr(
        settings, "SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET", None,
    ):
        if settings.MULTI_TENANCY:
            google = True
        else:
            try:
                from ee.models.license import License
            except ImportError:
                pass
            else:
                license = License.objects.first_valid()
                if license is not None and "google_login" in license.available_features:
                    google = True
                else:
                    print_warning(["You have Google login set up, but not the required premium PostHog plan!"])
    return {"google-oauth2": google, "github": github, "gitlab": gitlab}
def flatten(l: Union[List, Tuple]) -> Generator:
    for el in l:
        if isinstance(el, list):
            yield from flatten(el)
        else:
            yield el
def get_daterange(