This project is archived and is in readonly mode.

Changeset [2f4aaed7b3feb3be787a316fab3144c06bb21a27] by Michael Koziarski

July 7th, 2008 @ 06:31 AM

Disable the Accept header by default

The accept header is poorly implemented by browsers and causes strange errors when used on public sites where crawlers make requests too. You should use formatted urls (e.g. /people/1.xml) to support API clients. Alternatively to re-enable it you need to set:

config.action_controller.use_accept_header = true

A special case remains for ajax requests which will have a javascript format for the base resource (/people/1) if the X-Requested-With header is present. This lets ajax pages still use format.js despite there being no params[:format]

http://github.com/rails/rails/co...

Committed by Repository

  • M actionpack/CHANGELOG
  • M actionpack/lib/action_controller/base.rb
  • M actionpack/lib/action_controller/caching/actions.rb
  • M actionpack/lib/action_controller/mime_responds.rb
  • M actionpack/lib/action_controller/request.rb
  • M actionpack/lib/action_view/base.rb
  • M actionpack/test/controller/caching_test.rb
  • M actionpack/test/controller/content_type_test.rb
  • M actionpack/test/controller/mime_responds_test.rb
  • M actionpack/test/controller/request_test.rb

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>