Sha256: f6de3c83d1c07b021e5f1667b21139641cd3c7fcf6906157cc00825e702ad2fb
Contents?: true
Size: 495 Bytes
Versions: 43
Compression:
Stored size: 495 Bytes
Contents
module ShopifyApp module Utils def self.sanitize_shop_domain(shop_domain) name = shop_domain.to_s.strip name += ".#{ShopifyApp.configuration.myshopify_domain}" if !name.include?("#{ShopifyApp.configuration.myshopify_domain}") && !name.include?(".") name.sub!(%r|https?://|, '') u = URI("http://#{name}") u.host && u.host.ends_with?(".#{ShopifyApp.configuration.myshopify_domain}") ? u.host : nil rescue URI::InvalidURIError nil end end end
Version data entries
43 entries across 43 versions & 1 rubygems