diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-05-24 11:56:01 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-05-24 11:56:01 +0200 |
commit | 54ba82b457262cc97852bc176d5d735c1aadd160 (patch) | |
tree | 422ec5078fbc85210e25b95b89af910bcbe075ed | |
parent | a3d2867681dd728fdf88039b9b29ca6d5d8a7097 (diff) |
fix content type for get model request
-rw-r--r-- | lazar.rb | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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}'" |