summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-05-05 12:42:43 +0200
committermguetlein <martin.guetlein@gmail.com>2010-05-05 12:42:43 +0200
commit9a9ff4fafda323b7ba26459e5634f711782ae07f (patch)
tree9ffa78f5d188d9147f07ea810937720481cb50e0
parenta7235bb51c2044c2a65c464fbbd1a55929fdfa30 (diff)
application/x-yaml to text/x-yaml, error if dataset not found
-rwxr-xr-x[-rw-r--r--]application.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index e0a6abc..a65c881 100644..100755
--- 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}'"