class Adsf::Rack::CORS

Public Class Methods

new(app) click to toggle source
# File lib/adsf/rack/cors.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/adsf/rack/cors.rb, line 9
def call(env)
  status, headers, body = *@app.call(env)

  new_headers =
    headers.merge(
      'access-control-allow-origin' => '*',
      'access-control-allow-headers' => 'Origin, X-Requested-With, Content-Type, Accept, Range',
    )

  [status, new_headers, body]
end