From b5dd1b659987bb6117c0f1657e66dc395cfbed5e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 17 Sep 2009 11:34:40 -0700 Subject: Fix brittle content-type check. [#1956 state:committed] --- activeresource/lib/active_resource/validations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activeresource/lib/active_resource') diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index d4d282e273..67b69fa505 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -93,9 +93,9 @@ module ActiveResource # content-type of the error-block received def load_remote_errors(remote_errors, save_cache = false ) #:nodoc: case remote_errors.response['Content-Type'] - when 'application/xml' + when /xml/ errors.from_xml(remote_errors.response.body, save_cache) - when 'application/json' + when /json/ errors.from_json(remote_errors.response.body, save_cache) end end -- cgit v1.2.3