Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (17 loc) · 552 Bytes

File metadata and controls

31 lines (17 loc) · 552 Bytes

shopify.utils.sanitizeHost

This method makes user inputs safer by ensuring that the host query arguments from Shopify requests is valid.

Example

const host = shopify.utils.sanitizeHost(req.query.host, true);

Parameters

host

string | ❗ required

The incoming host value.

throwOnInvalid

boolean | Defaults to false

If true, throws an error when the host is invalid.

Return

string | null

The host value if it is properly formatted, otherwise null.

Back to shopify.utils