Class: UREST::GetProg

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/urest.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



169
170
171
172
173
174
175
176
177
178
# File 'lib/urest.rb', line 169

def response
  opts = @a[0]
  fname = File.join(opts['dir'],@r[1..-1].join('/'))
  if opts['progs'].include? fname
    return Riddl::Parameter::Complex.new('file','application/octet-stream',UREST::download_program(opts,fname),File.basename(fname))
  else
    @status = 403
  end
  nil
end