aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource
diff options
context:
space:
mode:
authorBob Aman <bob@sporkmonger.com>2009-01-28 20:56:02 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-01-28 20:56:46 +0000
commit166c63818e901e64786a76029febf7c9cdb40f2d (patch)
treef0398c5cfea0d55f32a5f3136d09fa428d1a2140 /activeresource/lib/active_resource
parent91eeb0ff119d34d0fcdb44d3d7fcbb7924208e05 (diff)
downloadrails-166c63818e901e64786a76029febf7c9cdb40f2d.tar.gz
rails-166c63818e901e64786a76029febf7c9cdb40f2d.tar.bz2
rails-166c63818e901e64786a76029febf7c9cdb40f2d.zip
Improve exception handling when Location header is invalid. [#1192 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r--activeresource/lib/active_resource/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 54dde43087..94418fb559 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -1006,7 +1006,7 @@ module ActiveResource
# Takes a response from a typical create post and pulls the ID out
def id_from_response(response)
- response['Location'][/\/([^\/]*?)(\.\w+)?$/, 1]
+ response['Location'][/\/([^\/]*?)(\.\w+)?$/, 1] if response['Location']
end
def element_path(options = nil)