lib/ahc_helper.rb in ahc-0.3.5 vs lib/ahc_helper.rb in ahc-0.3.6
- old
+ new
@@ -51,17 +51,20 @@
end
def call(env)
request = Rack::Request.new(env)
path = request.fullpath
+
if path.start_with?('/s/') || path.start_with?('/static/') || path.start_with?('/plovr/')
begin
response = Net::HTTP.get(URI.parse("http://#{Ahc.host || Ahc.default_host}:#{Ahc.port || Ahc.default_port}" + path))
- return [200, {}, [response]]
+ headers = path.end_with?('.css') ? {"Content-Type"=>"text/css"} : {}
+ return [200, headers, [response]]
rescue
return [200, {}, ['Ahc server is not running']]
end
end
+
@app.call(env)
end
end