Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed bug where middleware DIDN'T ACTUALLY WORK, but tests were passing

  • Loading branch information...
commit 95a32645b4d229516da082f8e9d53861aad45b1e 1 parent e228231
madlep authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/made_in_railscamp.rb
View
6 lib/made_in_railscamp.rb
@@ -21,11 +21,11 @@ def call(env)
def say_made_at_railscamp!(body, headers)
calc_content_length = headers.include?('Content-Length')
new_content_length = 0
- new_body = body.inject([]) do |new_body_acc, body_part|
+ new_body = []
+ body.each do |body_part|
new_body_part = body_part.gsub(/<\/body>/, "#{@message}</body>")
- new_body_acc << new_body_part
+ new_body << new_body_part
new_content_length += Rack::Utils.bytesize(new_body_part) if calc_content_length
- new_body_acc
end
if calc_content_length
Please sign in to comment.
Something went wrong with that request. Please try again.