1- require File . expand_path ( '../boot' , __FILE__ )
2- require File . expand_path ( '../../app/models/site_setting.rb' , __FILE__ )
1+ # frozen_string_literal: true
2+
3+ require File . expand_path ( 'boot' , __dir__ )
4+ require File . expand_path ( '../app/models/site_setting.rb' , __dir__ )
35
46require 'rails/all'
57
@@ -24,7 +26,7 @@ class Application < Rails::Application
2426 # config.i18n.default_locale = :de
2527
2628 # Configure sensitive parameters which will be filtered from the log file.
27- config . filter_parameters += [ : password, : session_id, : api_password, : submission_file, : return_file, : test_output, : stdout, : stderr, : vm_log]
29+ config . filter_parameters += %i[ password session_id api_password submission_file return_file test_output stdout stderr vm_log ]
2830
2931 config . active_record . raise_in_transactional_callbacks = true
3032
@@ -33,20 +35,20 @@ class Application < Rails::Application
3335
3436 config . relative_url_root = SiteSetting . value ( 'base_path' )
3537
36- config . middleware . insert_before 0 , " Rack::Cors" , : debug => true , : logger => ( -> { Rails . logger } ) do
38+ config . middleware . insert_before 0 , ' Rack::Cors' , debug : true , logger : ( -> { Rails . logger } ) do
3739 allow do
3840 origins '*'
3941 resource '/oauth*' , headers : :any , methods : :any
4042 resource '/api*' , headers : :any , methods : :any
4143 end
4244 allow do
4345 origins SiteSetting . all_settings [ 'cors_origins' ]
44- resource '/auth*' , headers : :any , methods : [ : get, : post]
46+ resource '/auth*' , headers : :any , methods : %i[ get post ]
4547 resource '/paste/*' , headers : :any , methods : [ :get ]
4648 resource '/courses' , headers : :any , methods : [ :get ]
4749 resource '/courses/*' , headers : :any , methods : [ :get ]
4850 resource '/courses/*/points*' , headers : :any , methods : [ :get ]
49- resource '/exercises/*' , headers : :any , methods : [ : get, : post]
51+ resource '/exercises/*' , headers : :any , methods : %i[ get post ]
5052 resource '/org/*/courses.json' , headers : :any , methods : [ :get ]
5153 resource '/org/*/courses/*' , headers : :any , methods : [ :get ]
5254 resource '/org/*/courses/*/points*' , headers : :any , methods : [ :get ]
0 commit comments