lib/snapa.rb in snapa-0.0.4 vs lib/snapa.rb in snapa-0.0.5
- old
+ new
@@ -1,7 +1,8 @@
require 'snapa/version'
require 'rack/file'
+require 'digest'
module Snapa
class File < Rack::File
def cmd
@@ -19,10 +20,10 @@
def build(request)
system [cmd, script, "'#{url(request)}'", "'#{@path}'"].join(' ')
end
def path(request)
- @path ||= F.join('/tmp/snapa', request.query_string + '.png')
+ @path ||= F.join('/tmp/snapa', ::Digest.hexencode(request.query_string) + '.png')
end
def _call(env)
request = ::Rack::Request.new(env)