Sha256: 93cdbbd13e5706306b3bf64d0e68517e1ba622d82b71b7fa6e35526c3893a185
Contents?: true
Size: 1.01 KB
Versions: 20
Compression:
Stored size: 1.01 KB
Contents
require "padrino-core" require "haml" require "pact_broker/services" require "pact_broker/string_refinements" module PactBroker module UI module Controllers class Base < Padrino::Application using PactBroker::StringRefinements set :root, File.join(File.dirname(__FILE__), "..") set :show_exceptions, ENV["RACK_ENV"] != "production" set :dump_errors, false # The padrino logger logs these for us. If this is enabled we get duplicate logging. def base_url # Using the X-Forwarded headers in the UI can leave the app vulnerable # https://www.acunetix.com/blog/articles/automated-detection-of-host-header-attacks/ # Either use the explicitly configured base url or an empty string, # rather than request.base_url, which uses the X-Forwarded headers. env["pactbroker.base_url"] || "" end helpers do def ellipsisize(string) string.ellipsisize end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems