mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
16 lines
393 B
Ruby
16 lines
393 B
Ruby
class Middleware
|
|
def initialize(app)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
status, headers, response = @app.call(env)
|
|
body = ''
|
|
response.each {|part| body += part }
|
|
if (env["PATH_INFO"] =~ /css$/)
|
|
body += "\n/* Added by Rack filter */"
|
|
status, headers, response = Rack::Response.new(body, status, headers).finish
|
|
end
|
|
[status, headers, response]
|
|
end
|
|
end
|