aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/validations.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-09-17 11:34:40 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-09-17 11:34:40 -0700
commitb5dd1b659987bb6117c0f1657e66dc395cfbed5e (patch)
treec6b1965c4041dd369d671413875bcf7e6645df93 /activeresource/lib/active_resource/validations.rb
parentc9d3c48dc6389feb2001372cd76e96274e773c9b (diff)
downloadrails-b5dd1b659987bb6117c0f1657e66dc395cfbed5e.tar.gz
rails-b5dd1b659987bb6117c0f1657e66dc395cfbed5e.tar.bz2
rails-b5dd1b659987bb6117c0f1657e66dc395cfbed5e.zip
Fix brittle content-type check. [#1956 state:committed]
Diffstat (limited to 'activeresource/lib/active_resource/validations.rb')
-rw-r--r--activeresource/lib/active_resource/validations.rb4
1 files changed, 2 insertions, 2 deletions
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