Sha256: 1a3d393ca3c6b12fea2a1eb921ebfe3658486187edd793484889022bed883e98

Contents?: true

Size: 936 Bytes

Versions: 9

Compression:

Stored size: 936 Bytes

Contents

# Original source code at
# https://github.com/dwaite/cookiejar/blob/master/lib/cookiejar/cookie_validation.rb
# Re-opening the CookieValidation module to rewrite the domains_match method to
# skip the validation of domains. Open issue at
# https://github.com/restforce/restforce/issues/120
module CoreExtensions
  module CookieJar
    module CookieValidation
      def self.extended(base)
        base.class_eval do
          def self.domains_match(tested_domain, base_domain)
            return true if tested_domain[-15..-1].eql?('.salesforce.com')

            # original implementation
            base = effective_host base_domain
            search_domains = compute_search_domains_for_host base
            search_domains.find do |domain|
              domain == tested_domain
            end
          end
        end
      end
    end
  end
end

CookieJar::CookieValidation.extend(CoreExtensions::CookieJar::CookieValidation)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
salesforce_streamer-1.2.1 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-1.2.0 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-1.1.3 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-1.1.1 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-1.1.0 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-1.0.0 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-0.5.0 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-0.4.1 lib/core_extensions/cookiejar/cookie_validation.rb
salesforce_streamer-0.4.0 lib/core_extensions/cookiejar/cookie_validation.rb