From 54ba82b457262cc97852bc176d5d735c1aadd160 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Tue, 24 May 2011 11:56:01 +0200 Subject: fix content type for get model request --- lazar.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lazar.rb b/lazar.rb index 7a1494a..019a0b2 100644 --- a/lazar.rb +++ b/lazar.rb @@ -6,13 +6,16 @@ get '/:id/?' do halt 404, "Model #{params[:id]} not found." unless File.exists? @yaml_file case @accept when /application\/rdf\+xml/ + response['Content-Type'] = 'application/rdf+xml' s = OpenTox::Serializer::Owl.new metadata = YAML.load_file(@yaml_file).metadata s.add_model(@uri,metadata) s.to_rdfxml when /yaml/ + response['Content-Type'] = 'application/x-yaml' File.read @yaml_file when /html/ + response['Content-Type'] = 'text/html' OpenTox.text_to_html File.read(@yaml_file) else halt 400, "Unsupported MIME type '#{@accept}'" -- cgit v1.2.3