nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
733 stars 303 forks source link

IsValidShopDomainAsync should check if shopDomain is a valid uri before building the shop domain uri #1067

Open waheedbhatti opened 2 months ago

waheedbhatti commented 2 months ago

Since the method IsValidShopDomainAsync is to determine whether the shopDomain variable is a valid shop domain it should also check if the shopDomain string is a valid uri before trying to build the shop domain uri.

For scenarios where the shop domain may have been entered by a user it is possible that it will not be a valid uri which will then throw an exception when passed to BuildShopDomainUri

nozzlegear commented 2 months ago

Hey, good catch! It used to do this, it looks like we lost this functionality when I rewrote the authorization service and split it into the ShopifyDomainUtility. It's using a UriBuilder to build the request url now, which must not do much validation. I'll add this validation back to the utility!

waheedbhatti commented 2 months ago

Thank you for all your great work!