Skip to content

Commit dd3b869

Browse files
committed
Merge pull request #170 from swipely/fix-expects-and-container-run
Add 304 not modified expectation and remove start on run
2 parents ab8dfd2 + 25fd4df commit dd3b869

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/docker/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def compile_request_params(http_method, path, query = nil, opts = nil, &block)
7777
:headers => { 'Content-Type' => content_type,
7878
'User-Agent' => user_agent,
7979
}.merge(headers),
80-
:expects => (200..204),
80+
:expects => (200..204).to_a << 304,
8181
:idempotent => http_method == :get,
8282
:request_block => block
8383
}.merge(opts).reject { |_, v| v.nil? }

lib/docker/container.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def wait(time = nil)
2626
# UnexpectedResponseError is raised.
2727
def run(cmd, time = 1000)
2828
if (code = tap(&:start).wait(time)['StatusCode']).zero?
29-
commit.run(cmd).tap(&:start)
29+
commit.run(cmd)
3030
else
3131
raise UnexpectedResponseError, "Command returned status code #{code}."
3232
end

0 commit comments

Comments
 (0)