Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #115 from guangyang/dev
Browse files Browse the repository at this point in the history
fix a blob API header
  • Loading branch information
guangyang committed Dec 5, 2013
2 parents 9fc69a0 + 3a5bf46 commit 69c58ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/azure/blob/blob_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def create_page_blob(container, blob, length, options={})
# ==== Options
#
# Accepted key/value pairs in options parameter are:
# * +:if_sequence_number_lte+ - If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails with the SequenceNumberConditionNotMet error (HTTP status code 412 - Precondition Failed).
# * +:if_sequence_number_le+ - If the blob's sequence number is less than or equal to the specified value, the request proceeds; otherwise it fails with the SequenceNumberConditionNotMet error (HTTP status code 412 - Precondition Failed).
# * +:if_sequence_number_lt+ - If the blob's sequence number is less than the specified value, the request proceeds; otherwise it fails with SequenceNumberConditionNotMet error (HTTP status code 412 - Precondition Failed).
# * +:if_sequence_number_eq+ - If the blob's sequence number is equal to the specified value, the request proceeds; otherwise it fails with SequenceNumberConditionNotMet error (HTTP status code 412 - Precondition Failed).
# * +:if_modified_since+ - A DateTime value. Specify this conditional header to write the page only if the blob has been modified since the specified date/time. If the blob has not been modified, the Blob service returns status code 412 (Precondition Failed).
Expand All @@ -486,7 +486,7 @@ def create_blob_pages(container, blob, start_range, end_range, content, options=

# set optional headers
unless options.empty?
headers["x-ms-if-sequence-number-lte"] = options[:if_sequence_number_lte] if options[:if_sequence_number_lte]
headers["x-ms-if-sequence-number-le"] = options[:if_sequence_number_le] if options[:if_sequence_number_le]
headers["x-ms-if-sequence-number-lt"] = options[:if_sequence_number_lt] if options[:if_sequence_number_lt]
headers["x-ms-if-sequence-number-eq"] = options[:if_sequence_number_eq] if options[:if_sequence_number_eq]
headers["If-Modified-Since"] = options[:if_modified_since] if options[:if_modified_since]
Expand Down
10 changes: 5 additions & 5 deletions test/unit/blob/blob_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -734,16 +734,16 @@
subject.create_blob_pages container_name, blob_name, start_range, end_range, content, { :if_sequence_number_lt => "isnlt-value" }
end

it "modifies the request headers when provided a :if_sequence_number_lte value" do
request_headers["x-ms-if-sequence-number-lte"] = "isnlte-value"
subject.create_blob_pages container_name, blob_name, start_range, end_range, content, { :if_sequence_number_lte => "isnlte-value" }
it "modifies the request headers when provided a :if_sequence_number_le value" do
request_headers["x-ms-if-sequence-number-le"] = "isnle-value"
subject.create_blob_pages container_name, blob_name, start_range, end_range, content, { :if_sequence_number_le => "isnle-value" }
end

it "modifies the request headers when provided a :if_modified_since value" do
request_headers["If-Modified-Since"] = "ims-value"
subject.create_blob_pages container_name, blob_name, start_range, end_range, content, { :if_modified_since => "ims-value" }
end

it "modifies the request headers when provided a :if_unmodified_since value" do
request_headers["If-Unmodified-Since"] = "iums-value"
subject.create_blob_pages container_name, blob_name, start_range, end_range, content, { :if_unmodified_since => "iums-value" }
Expand Down

0 comments on commit 69c58ad

Please sign in to comment.