Module: Inferno::DSL::Runnable

Defined in:
lib/davinci_crd_test_kit/ext/inferno_core/runnable.rb

Constant Summary collapse

PRE_FLIGHT_HANDLER =
proc do
  [
    200,
    {
      'Access-Control-Allow-Origin' => '*',
      'Access-Control-Allow-Headers' => 'Content-Type, Authorization'
    },
    ['']
  ]
end

Instance Method Summary collapse

Instance Method Details

#allow_cors(*paths) ⇒ Object



15
16
17
18
19
# File 'lib/davinci_crd_test_kit/ext/inferno_core/runnable.rb', line 15

def allow_cors(*paths)
  paths.each do |path|
    route(:options, path, PRE_FLIGHT_HANDLER)
  end
end