lib/pdf_mage/workers/base.rb
def secretize_url(url)
        unless string_exists?(url) && (uri = URI(url)) && uri.scheme&.match(/^https?$/)
          raise ArgumentError, 'url must be a valid url using the http/s protocol.'
        end

        if CONFIG.api_secret
          new_query_params = URI.decode_www_form(uri.query.to_s) << ['secret', CONFIG.api_secret]
          uri.query = URI.encode_www_form(new_query_params)
          uri.to_s
        else
          url
        end
      end
# Adds the API secret to a URL.
#
# @param [String] url - URL to add the API secret from the config to
# @return [String] url with secret
#
# @raise [ArgumentError] if url is nil or an empty string
Adds the API secret to a URL.
Adds the API secret to a URL .
def secretize_url(url)
        unless string_exists?(url) && (uri = URI(url)) && uri.scheme&.match(/^https?$/)
          raise ArgumentError, 'url must be a valid url using the http/s protocol.'
        end
        if CONFIG.api_secret
          new_query_params = URI.decode_www_form(uri.query.to_s) << ['secret', CONFIG.api_secret]
          uri.query = URI.encode_www_form(new_query_params)
          uri.to_s
        else
          url
        end
      end
def secretize_url ( url ) unless string_exists? ( url ) && ( uri = URI ( url ) ) && uri . scheme &. match ( / ^https?$ / ) raise ArgumentError , 'url must be a valid url using the http/s protocol.' end if CONFIG . api_secret new_query_params = URI . decode_www_form ( uri . query . to_s ) << [ 'secret' , CONFIG . api_secret ] uri . query = URI . encode_www_form ( new_query_params ) uri . to_s else url end end
Adds the API secret to a URL.
Adds the API secret to a URL .
url with secret
url with secret
String
[ArgumentError] if url is nil or an empty string
[ ArgumentError ] if url is nil or an empty string
url
URL to add the API secret from the config to
URL to add the API secret from the config to