From 1fc1986d6deacd71ec4bea2287d9cfed6123b898 Mon Sep 17 00:00:00 2001 From: Jatinder Singh Date: Sun, 9 Aug 2009 22:24:50 +0100 Subject: Make ActiveResource#exists? work [#3020 state:resolved] Signed-off-by: Pratik Naik --- activeresource/lib/active_resource/connection.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activeresource/lib') diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index c08b7272ae..884c425c1d 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -13,7 +13,8 @@ module ActiveResource HTTP_FORMAT_HEADER_NAMES = { :get => 'Accept', :put => 'Content-Type', :post => 'Content-Type', - :delete => 'Accept' + :delete => 'Accept', + :head => 'Accept' } attr_reader :site, :user, :password, :timeout, :proxy, :ssl_options @@ -93,7 +94,7 @@ module ActiveResource # Executes a HEAD request. # Used to obtain meta-information about resources, such as whether they exist and their size (via response headers). def head(path, headers = {}) - request(:head, path, build_request_headers(headers)) + request(:head, path, build_request_headers(headers, :head)) end -- cgit v1.2.3