Sha256: 90a358e2c9b00735141867725d576b85e1cbcb23e05ca38e1f53478ff82c38e5
Contents?: true
Size: 878 Bytes
Versions: 1
Compression:
Stored size: 878 Bytes
Contents
# frozen_string_literal: true module ShopifyApp module SanitizedParams protected def sanitized_shop_name @sanitized_shop_name ||= sanitize_shop_param(params) end def referer_sanitized_shop_name return unless request.referer.present? @referer_sanitized_shop_name ||= begin referer_uri = URI(request.referer) query_params = Rack::Utils.parse_query(referer_uri.query) sanitize_shop_param(query_params.with_indifferent_access) end end def sanitize_shop_param(params) return unless params[:shop].present? ShopifyApp::Utils.sanitize_shop_domain(params[:shop]) end def sanitized_params request.query_parameters.clone.tap do |query_params| if params[:shop].is_a?(String) query_params[:shop] = sanitize_shop_param(params) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shopify_app-20.1.0 | lib/shopify_app/controller_concerns/sanitized_params.rb |