Method: Rack::CopyMachine#modify_body
- Defined in:
- lib/rack/copy_machine.rb
#modify_body ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rack/copy_machine.rb', line 26 def modify_body full_body = @response.body.join full_body.sub! /<\/head>/, "</head>\n" + yield @response["Content-Length"] = full_body.size.to_s @response.body = [full_body] end |