I figured this out. See http://stackoverflow.com/a/8607403/162876. For
Rails 3.1, in your config/application.rb set
config.action_dispatch.ignore_accept_header=true and your problems
should disappear. Mine have.

The problem is that Rails will use Accept headers as formats
specifications, and many bots and mobile devices send non-standard
Accept headers for which Rails has no mime type defined. That results
in an app error. The config option mentioned turns off Accept header
recognition making your app rely only on formatted URLs.

For Rails < 3.1 this option may exist, or you could mimic it somehow.
The 2.2 release notes (http://guides.rubyonrails.org/
2_2_release_notes.html) state "The HTTP Accept header is disabled by
default now. You should prefer the use of formatted URLs (such as /
customers/1.xml) to indicate the format that you want." Making me
wonder why this doesn't seem to be the case in 3.1 at least.


On Jan 9, 1:36 pm, Christopher Stump <[email protected]> wrote:
> Same here. I've since gotten one exception.
>
>
>
>
>
>
>
> On Mon, Jan 9, 2012 at 7:45 AM, Rob Zolkos <[email protected]> wrote:
> > I tried the hotfix in the past hour and still got the exception.
>
> > Sent from my iPhone
>
> > On 10/01/2012, at 12:37 AM, Chris <[email protected]> wrote:
>
> > > I'm having this same problem using Rack 1.3.6 on a Ruby 1.9.2/Rails
> > > 3.1.3 stack, so the issue isn't isolated to Rack < 1.3.0. I'm trying
> > > the hotfix to see if it works.
>
> > > On Jan 9, 4:54 am, Rob Zolkos <[email protected]> wrote:
> > >> Thanks Daniel.  I'll give that a go.
>
> > >> On Mon, Jan 9, 2012 at 9:45 PM, Daniel Sabados <
> > [email protected]> wrote:
> > >>> Hi Rob,
>
> > >>> It could be an encoding problem with Rack.  It sets the format
> > >>> as "*/*;q=0.6" instead of "*/*".
>
> > >>> Rack 1.3.0 apparently fixes this but in the mean time I found a patch
> > which
> > >>> resolved our issue:
> > >>>https://github.com/agehret/asino/blob/master/config/initializers/rack.
> > ..
>
> > >>> Just create an initializer with the above code and see how you go.
>
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "Ruby or Rails Oceania" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > [email protected].
> > > For more options, visit this group at
> >http://groups.google.com/group/rails-oceania?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby or Rails Oceania" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to