Production website on Rails 4.2.1
Everything fine, but occasionally get strange error on the home page:
Missing template home/index, application/index with {:locale=>[:en], :formats=>["text/html;text/plain"], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
[...] /releases/20150619150924/app/views"
[...] shared/bundle/ruby/2.1.0/gems/devise-3.5.1/app/views"
Obviously app/views/home/index.html.erb exists and works fine most of time, but it seems to miss once in a while. Not sure what is going on here, how can this happen only occasionally? I never get this on staging or dev.
Please note only happens once every few hundred page views.
Am I missing something here? Be grateful for any pointers.
The reason of this error is the incorrect header, you can simply reproduce it via the curl request:
Seems someone made a mistake when wrote his bot. This one is correct:
This one is valid too:
RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
You can fix it through the middleware: