Automatically sets the ETag header on all String bodies
(Not documented)
# File lib/rack/etag.rb, line 10
10: def call(env)
11: status, headers, body = @app.call(env)
12:
13: if !headers.has_key?('ETag')
14: parts = []
15: body.each { |part| parts << part.to_s }
16: headers['ETag'] = %("#{Digest::MD5.hexdigest(parts.join(""))}")
17: [status, headers, parts]
18: else
19: [status, headers, body]
20: end
21: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.