lib/rdf/ldp/resource.rb in rdf-ldp-0.6.0 vs lib/rdf/ldp/resource.rb in rdf-ldp-0.7.0
- old
+ new
@@ -244,14 +244,16 @@
#
# @raise [RDF::LDP::RequestError] when update fails. May raise various
# subclasses for the appropriate response codes.
def update(input, content_type, &block)
return create(input, content_type, &block) unless exists?
+
@data.transaction(mutable: true) do |transaction|
yield transaction if block_given?
set_last_modified(transaction)
end
+
self
end
##
# Mark the resource as destroyed.
@@ -453,10 +455,12 @@
end
##
# Process & generate response for DELETE requests.
def delete(status, headers, env)
- [204, headers, destroy]
+ destroy
+ headers.delete('Content-Type')
+ [204, headers, []]
end
##
# @abstract implement in subclasses as needed to support HTTP PATCH
def patch(*)