diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-09 18:06:01 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-09 18:06:01 +0100 |
commit | 448ab18a201c902b4e7a1aa468c352c20d034989 (patch) | |
tree | 5c33573bac66ded15ed009de707da3e64aeffd7c /app | |
parent | b13e7dda1f33be43d1667b754b67df71f3187a5c (diff) |
Replace setting custom CORS headers with rack-cors, set it on /oauth/token endpoint
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/api_controller.rb | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 5243f7d7b..ef453799b 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -7,7 +7,6 @@ class ApiController < ApplicationController skip_before_action :verify_authenticity_token before_action :set_rate_limit_headers - before_action :set_cors_headers rescue_from ActiveRecord::RecordInvalid do |e| render json: { error: e.to_s }, status: 422 @@ -50,13 +49,6 @@ class ApiController < ApplicationController response.headers['X-RateLimit-Reset'] = (now + (match_data[:period] - now.to_i % match_data[:period])).to_s end - def set_cors_headers - response.headers['Access-Control-Allow-Origin'] = '*' - response.headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' - response.headers['Access-Control-Request-Method'] = '*' - response.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' - end - def set_pagination_headers(next_path = nil, prev_path = nil) links = [] links << [next_path, [['rel', 'next']]] if next_path |