Class: LtiPublicResources::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- LtiPublicResources::ApplicationController
show all
- Defined in:
- app/controllers/lti_public_resources/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#cors_preflight_check ⇒ Object
If this is a preflight OPTIONS request, then short-circuit the request, return only the necessary headers and return an empty text/plain.
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/lti_public_resources/application_controller.rb', line 33
def cors_preflight_check
if request.method == :options
['Access-Control-Allow-Origin'] = '*'
['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
['Access-Control-Allow-Headers'] = '*'
['Access-Control-Max-Age'] = '1728000'
render :text => '', :content_type => 'text/plain'
end
end
|
For all responses in this controller, return the CORS access control headers.
22
23
24
25
26
27
28
|
# File 'app/controllers/lti_public_resources/application_controller.rb', line 22
def
['Access-Control-Allow-Origin'] = '*'
['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
['Access-Control-Request-Method'] = '*'
['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
['Access-Control-Max-Age'] = "1728000"
end
|
#ga_domain ⇒ Object
12
13
14
|
# File 'app/controllers/lti_public_resources/application_controller.rb', line 12
def ga_domain
LtiPublicResources.ga_domain || ""
end
|
#ga_tracking_code ⇒ Object
7
8
9
|
# File 'app/controllers/lti_public_resources/application_controller.rb', line 7
def ga_tracking_code
LtiPublicResources.ga_tracking_code || ""
end
|
17
18
19
|
# File 'app/controllers/lti_public_resources/application_controller.rb', line 17
def
response.['X-Frame-Options'] = 'ALLOWALL'
end
|