Skip to content

Commit

Permalink
Always return a Rack body that has an #each method
Browse files Browse the repository at this point in the history
Closes Issue efficiency20#2
  • Loading branch information
brynary committed Mar 16, 2011
1 parent cc793ab commit c26f1f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/e20/ops/middleware/revision_middleware.rb
Expand Up @@ -15,7 +15,7 @@ def initialize(app, options = {})
def call(env)
if env["PATH_INFO"] == "/system/revision"
body = "#{@revision}\n"
[200, { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s }, body]
[200, { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s }, [body]]
else
status, headers, body = @app.call(env)
headers["X-Revision"] = @revision.to_s
Expand Down
2 changes: 1 addition & 1 deletion spec/ops/middleware/revision_middleware_spec.rb
Expand Up @@ -11,7 +11,7 @@
it "returns the current running revision" do
middleware = E20::Ops::Middleware::RevisionMiddleware.new(app, :revision => "rev")
status, headers, body = middleware.call({"PATH_INFO" => "/system/revision"})
body.should == "rev\n"
body.should == ["rev\n"]
end
end

Expand Down

0 comments on commit c26f1f8

Please sign in to comment.