summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-05-24 11:56:01 +0200
committermguetlein <martin.guetlein@gmail.com>2011-05-24 11:56:01 +0200
commit54ba82b457262cc97852bc176d5d735c1aadd160 (patch)
tree422ec5078fbc85210e25b95b89af910bcbe075ed
parenta3d2867681dd728fdf88039b9b29ca6d5d8a7097 (diff)
fix content type for get model request
-rw-r--r--lazar.rb3
1 files changed, 3 insertions, 0 deletions
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}'"