You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
822 B

require 'simpleidn'
7 years ago
class SiteController < ApplicationController
def check
host, port, type = params[:host], params[:port], params[:type]
host = SimpleIDN.to_ascii host.downcase
if host.blank? or /[^a-zA-Z0-9.-]/ =~ host
flash[:danger] = "Hôte #{host} invalide"
render :index
return
end
unless port.blank?
port = port.to_i
unless (1..65535).include? port
flash[:danger] = "Port #{port} invalide"
render :index
return
end
host = "#{host}:#{port}"
end
unless %w(https smtp xmpp tls ssh).include? type
flash[:danger] = "Type #{type} invalide"
render :index
return
end
redirect_to "/#{type}/#{host}"
end
def suite
@suite = params[:id] || params.require(:suite)
@ciphers = CryptCheck::Tls::Cipher.list @suite
7 years ago
end
5 years ago
def help
end
def about
end
7 years ago
end