Created
July 21, 2014 16:23
-
-
Save kurko/724c2a435ec0840e2872 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
#protect_from_forgery with: :exception | |
before_action :set_headers | |
def set_headers | |
headers["Endpoint-Purpose"] = "point_of_sale" | |
if Rails.env.development? | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' | |
headers['Access-Control-Request-Method'] = '*' | |
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment