module ApiTester::ServerInformation

Module for ensuring the server isn't broadcasting information about itself

Public Class Methods

go(contract) click to toggle source
# File lib/api-tester/modules/server_information.rb, line 6
def self.go(contract)
  reports = []
  endpoint = contract.endpoints[0]
  response = endpoint.default_call contract.base_url

  %i[server x_powered_by x_aspnetmvc_version x_aspnet_version].each do |key|
    if response.headers[key]
      reports << ServerBroadcastReport.new(response.headers[key],
                                           key)
    end
  end

  reports
end
order() click to toggle source
# File lib/api-tester/modules/server_information.rb, line 21
def self.order
  10
end