Avoid ActionView::MissingTemplate occurred in sessions#new

Some browser request /:foodcoop/login with the HTTP-Accept-Header set
to "image/webp,image/*;q=0.8", which leads to an internal server error
due to a not existing template. Call respond_to to allow only html and
respond with the correct "406 Not Acceptable" HTTP status code.
This commit is contained in:
Patrick Gansterer 2018-12-31 16:02:04 +01:00
parent 7e88798778
commit 8c6d48da86

View file

@ -2,8 +2,11 @@ class SessionsController < ApplicationController
skip_before_filter :authenticate
layout 'login'
def new
respond_to do |format|
format.html
end
end
def create