lib/apia/rack.rb
# Add cross origin headers to the response triplet
#
# @param env [Hash]
# @param triplet [Array]
# @return [void]
Add cross origin headers to the response triplet
Add cross origin headers to the response triplet
def add_cors_headers(env, triplet)
      triplet[1]['Access-Control-Allow-Origin'] = '*'
      triplet[1]['Access-Control-Allow-Methods'] = '*'
      if env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']
        triplet[1]['Access-Control-Allow-Headers'] = env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']
      end
      true
    end
def add_cors_headers ( env , triplet ) triplet [ 1 ] [ 'Access-Control-Allow-Origin' ] = '*' triplet [ 1 ] [ 'Access-Control-Allow-Methods' ] = '*' if env [ 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS' ] triplet [ 1 ] [ 'Access-Control-Allow-Headers' ] = env [ 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS' ] end true end
Add cross origin headers to the response triplet
Add cross origin headers to the response triplet
None
void
env
<not_specific>
triplet
<not_specific>
<not_specific>
None