Sha256: 11b8fdb0f2dac1823aae0bb1a7d8672a80ac34aea2c328c10644757f87ee7ad3

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

class GetDiplomas < RPCQooxdooPath
  def self.parse_req_res( req, res )
    dputs( 4 ){ "GetDiplomas: #{req.inspect}" }
    path, query, addr = req.path, req.query.to_sym, RPCQooxdooHandler.get_ip( req )
    if req.request_method == 'GET'
      filename = RPCQooxdooPath.sanitize(path.sub( /^.[^\/]*./, '' ))
      res['content-type'] = case filename
      when /pdf$/i
        'application/pdf'
      when /png$/i
        'image/png'
      end
      dputs(4){"Request is #{req.inspect}" }
      dputs(3){"filename is #{filename} - content-type is #{res['content-type']}" }
      return IO.read( Courses.dir_diplomas + '/' + filename ).
        force_encoding('ASCII-8BIT')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gestion-1.9.1312 Paths/GetDiplomas.rb
gestion-1.9.12 Paths/GetDiplomas.rb