Top Level Namespace

Defined Under Namespace

Modules: Pact, RackReverseProxy

Instance Method Summary collapse

Instance Method Details

#pact_provider_request_headers_method_foundObject



23
24
25
26
27
28
29
30
31
# File 'lib/pact/provider_verifier/underscored_headers_monkeypatch.rb', line 23

def pact_provider_request_headers_method_found
  begin
    Pact::Provider::Request::Replayable.instance_method(:headers)
    true
  rescue NameError
    Pact.configuration.error_stream.puts "WARN: Could not find the Pact::Provider::Request::Replayable#headers method. The implementation must have changed. Cannot monkey patch the aforementioned method to ensure any underscores are retained in header names. You can ignore this warning if you use normal dasherized headers."
    false
  end
end

#rack_reverse_proxy_headers_method_foundObject



13
14
15
16
17
18
19
20
21
# File 'lib/pact/provider_verifier/underscored_headers_monkeypatch.rb', line 13

def rack_reverse_proxy_headers_method_found
  begin
    RackReverseProxy::RoundTrip.instance_method(:headers)
    true
  rescue NameError
    Pact.configuration.error_stream.puts "WARN: Could not find the RackReverseProxy::RoundTrip#headers method. The implementation must have changed. Cannot monkey patch the aforementioned method to ensure any underscores are retained in header names. You can ignore this warning if you use normal dasherized headers."
    false
  end
end