Sha256: fbf24c6b78d5cea4a9cffc647709c2d4f2184e4e6221fb0f24953b29013bf4d2
Contents?: true
Size: 588 Bytes
Versions: 17
Compression:
Stored size: 588 Bytes
Contents
# frozen_string_literal: true require 'rack' module OpenTracing module Instrumentation module Rack # RegexpHostSanitazer sanitaze host class RegexpHostSanitazer DEFAULT_REPLACE_MAP = { '\1.0.0.0' => /^(\d+)\.\d+\.\d+\.\d+:\d+$/, }.freeze def initialize(replace_map: DEFAULT_REPLACE_MAP) @replace_map = replace_map end def sanitaze_host(host) @replace_map.each do |pattern, regexp| host = host.gsub(regexp, pattern) end host end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems