From ce08d7abb83a1675bd98804ad06e00271c408863 Mon Sep 17 00:00:00 2001 From: Jonathon Padfield Date: Wed, 3 May 2017 13:31:52 +1000 Subject: [PATCH] Replaced render :text 404 with :plain in omniauth Rails 5.1 has deprecated render :text, and HEAD requests on the omniauth callbacks passthru method is causing errors because the render :text is non-existant, and there's no template to fall back to. Replacing :text with :plain, adds a content-type type of text/plain and also returns the previous message. render :plain was supported back in rails 4.1.0 http://api.rubyonrails.org/v4.1.0/classes/ActionView/Helpers/RenderingHelper.html#method-i-render --- app/controllers/devise/omniauth_callbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/devise/omniauth_callbacks_controller.rb b/app/controllers/devise/omniauth_callbacks_controller.rb index e89233bf..d5b2c094 100644 --- a/app/controllers/devise/omniauth_callbacks_controller.rb +++ b/app/controllers/devise/omniauth_callbacks_controller.rb @@ -2,7 +2,7 @@ class Devise::OmniauthCallbacksController < DeviseController prepend_before_action { request.env["devise.skip_timeout"] = true } def passthru - render status: 404, text: "Not found. Authentication passthru." + render status: 404, plain: "Not found. Authentication passthru." end def failure