Skip to content

Commit

Permalink
Use If-Unmodified-Since header instead of If-Match due to issue with …
Browse files Browse the repository at this point in the history
…strong vs. weak etags
  • Loading branch information
cjcolvar committed Nov 21, 2016
1 parent 8a9c80e commit 36520b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ldp/resource.rb
Expand Up @@ -66,7 +66,7 @@ def head
# Delete the resource
def delete
client.delete subject do |req|
req.headers['If-Match'] = get.etag if retrieved_content?
req.headers['If-Unmodified-Since'] = get.last_modified if retrieved_content?
end
end

Expand Down Expand Up @@ -95,7 +95,7 @@ def create &block
def update new_content = nil
new_content ||= content
resp = client.put subject, new_content do |req|
req.headers['If-Match'] = get.etag if retrieved_content?
req.headers['If-Unmodified-Since'] = get.last_modified if retrieved_content?
yield req if block_given?
end
update_cached_get(resp) if retrieved_content?
Expand Down

0 comments on commit 36520b2

Please sign in to comment.