Class: WEBrick::HTTPRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/mock_service/server/webrick_request_monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

#meta_varsObject



5
6
7
8
9
10
11
12
13
# File 'lib/pact/mock_service/server/webrick_request_monkeypatch.rb', line 5

def meta_vars
  original_underscored_headers = []
  self.each{|key, val| original_underscored_headers << key if key.include?("_") }
  # This header allows us to restore the original format (eg. underscored) of the headers
  # when parsing the incoming Rack env back to a response object.
  vars = pact_original_meta_vars
  vars["X_PACT_UNDERSCORED_HEADER_NAMES"] = original_underscored_headers.join(",")
  vars
end

#pact_original_meta_varsObject



3
# File 'lib/pact/mock_service/server/webrick_request_monkeypatch.rb', line 3

alias_method :pact_original_meta_vars, :meta_vars