Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: bddd139589
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.555 kb
module Imagery
class RemoteProxy
include SendFile
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
requested_file = Image.new(env['imagery.origin_host'], env['PATH_INFO'] + (env['QUERY_STRING'].empty? ? '' : "?#{env['QUERY_STRING']}"))
# If file exists we simply sent it to the client.
if requested_file.found?
Logger.current.info "Requested file exists upstream."
send_file(requested_file)
else
@app.call(env)
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.