Skip to content

Throw an error when malformed host is passed in CreateHttpClientParams to createHttpClient #439

@catchergeese

Description

@catchergeese

Hi 👋

I use JavaScript Contentful SDK. It allows to specify host param. I use it to create either a delivery or preview Contentful client.

Recently, I accidentally passed https://preview.contentful.com instead of preview.contentful.com when moving from custom HTTP client to JS CTF SDK. While in the hindsight it seems like an obvious mistake of mine, it took some time to discover.

Do you think it would make sense to throw an Error when host param is passed and it doesn't match the expected format here? Currently, it fails silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions