Skip to content

Instantly share code, notes, and snippets.

@bethesque
Created November 27, 2014 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bethesque/203e9d2ec08f4a40d2df to your computer and use it in GitHub Desktop.
Save bethesque/203e9d2ec08f4a40d2df to your computer and use it in GitHub Desktop.
Modifying headers before replaying request using Pact
class ProxyApp
def initialize real_app
@real_app = real_app
end
def call env
@real_app.call(env.merge('HTTP_AUTHORIZATION' => '12345'))
end
end
Pact.service_provider "Some Provider" do
app do
ProxyApp.new(RealApp)
end
honours_pact_with "Some Consumer" do
#...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment