diff --git a/frameworks/Ruby/rails/Gemfile b/frameworks/Ruby/rails/Gemfile index 26129ee6261..bafb2012b49 100644 --- a/frameworks/Ruby/rails/Gemfile +++ b/frameworks/Ruby/rails/Gemfile @@ -7,3 +7,4 @@ gem 'activerecord-import', '0.27.0' gem 'activerecord', '5.2.2', :require => 'active_record' gem 'rails', '5.2.2' gem 'tzinfo-data', '1.2018.7' +gem 'oj', '3.7.9' diff --git a/frameworks/Ruby/rails/app/controllers/application_controller.rb b/frameworks/Ruby/rails/app/controllers/application_controller.rb index 09705d12ab4..bc62d8e6dda 100644 --- a/frameworks/Ruby/rails/app/controllers/application_controller.rb +++ b/frameworks/Ruby/rails/app/controllers/application_controller.rb @@ -1,2 +1,11 @@ class ApplicationController < ActionController::Base + + before_action :add_header + +protected + + def add_header + response.set_header('Date', Time.now.httpdate) + end + end diff --git a/frameworks/Ruby/rails/config/application.rb b/frameworks/Ruby/rails/config/application.rb index 063c4e6756d..17005bf74c1 100644 --- a/frameworks/Ruby/rails/config/application.rb +++ b/frameworks/Ruby/rails/config/application.rb @@ -27,6 +27,6 @@ class Application < Rails::Application # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - config.action_dispatch.default_headers.merge!('Date' => Time.now.httpdate, 'Server' => 'WebServer') + config.action_dispatch.default_headers.merge!('Server' => 'WebServer') end end diff --git a/frameworks/Ruby/rails/config/initializers/oj.rb b/frameworks/Ruby/rails/config/initializers/oj.rb new file mode 100644 index 00000000000..8c00f0456ff --- /dev/null +++ b/frameworks/Ruby/rails/config/initializers/oj.rb @@ -0,0 +1 @@ +Oj.optimize_rails