From 9a9ff4fafda323b7ba26459e5634f711782ae07f Mon Sep 17 00:00:00 2001 From: mguetlein Date: Wed, 5 May 2010 12:42:43 +0200 Subject: application/x-yaml to text/x-yaml, error if dataset not found --- application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 application.rb diff --git a/application.rb b/application.rb old mode 100644 new mode 100755 index e0a6abc..a65c881 --- a/application.rb +++ b/application.rb @@ -51,13 +51,14 @@ get '/:id' do case params[:id] when /.yaml$/ params[:id].sub!(/.yaml$/,'') - accept = 'application/x-yaml' + accept = 'text/x-yaml' when /.rdf$/ params[:id].sub!(/.rdf$/,'') accept = 'application/rdf+xml' end begin dataset = Dataset.get(params[:id]) + halt 404, "Dataset #{params[:id]} not found." unless dataset rescue => e raise e.message + e.backtrace halt 404, "Dataset #{params[:id]} not found." @@ -71,7 +72,7 @@ get '/:id' do end dataset.owl when /yaml/ - response['Content-Type'] = 'application/x-yaml' + response['Content-Type'] = 'text/x-yaml' dataset.yaml else halt 400, "Unsupported MIME type '#{accept}'" -- cgit v1.2.3