Sha256: c14130d302357e241e19cdd7dabe6f489d6d582a8aa72585c9a249be6eb2483d

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

module CMSScanner
  class Error < RuntimeError
  end

  # HTTP Authentication Required Error
  class HTTPAuthRequiredError < Error
    # :nocov:
    def to_s
      'HTTP authentication required (or was invalid), please provide it with --http-auth'
    end
    # :nocov:
  end

  # Proxy Authentication Required Error
  class ProxyAuthRequiredError < Error
    # :nocov:
    def to_s
      'Proxy authentication required (or was invalid), please provide it with --proxy-auth'
    end
    # :nocov:
  end

  # Access Forbidden Error
  class AccessForbiddenError < Error
    # :nocov:
    def to_s
      'The target is responding with a 403, this might be due to a WAF. ' \
      'Please re-try with --random-user-agent'
    end
    # :nocov:
  end

  # HTTP Redirect Error
  class HTTPRedirectError < Error
    attr_reader :redirect_uri

    # @param [ String ] url
    def initialize(url)
      @redirect_uri = Addressable::URI.parse(url).normalize
    end

    def to_s
      "The URL supplied redirects to #{redirect_uri}. Use the --ignore-main-redirect "\
      'option to ignore the redirection and scan the target.'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cms_scanner-0.0.36 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.35.1 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.35 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.34 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.33 lib/cms_scanner/errors/http.rb