deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/3] git commit: CIMI - default to a content type for response when cimi request
Date Wed, 07 Nov 2012 11:21:32 GMT
Updated Branches:
  refs/heads/master c4889e4d4 -> c67978132


CIMI - default to a content type for response when cimi request


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/c6797813
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/c6797813
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/c6797813

Branch: refs/heads/master
Commit: c67978132376ecd24044a025136b1e7c94520898
Parents: b21a513
Author: marios <marios@redhat.com>
Authored: Wed Nov 7 11:21:47 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Wed Nov 7 11:21:47 2012 +0200

----------------------------------------------------------------------
 server/lib/sinatra/rack_accept.rb |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c6797813/server/lib/sinatra/rack_accept.rb
----------------------------------------------------------------------
diff --git a/server/lib/sinatra/rack_accept.rb b/server/lib/sinatra/rack_accept.rb
index 3be919c..036b5ac 100644
--- a/server/lib/sinatra/rack_accept.rb
+++ b/server/lib/sinatra/rack_accept.rb
@@ -79,7 +79,11 @@ module Rack
         end
         yield wants
 
-        if Deltacloud.default_frontend.name == :cimi
+        if request.env["SCRIPT_NAME"].include?("cimi") || Deltacloud.default_frontend.name
== :cimi
+          #when cimi and neither json or xml defined... default to _something_  -  json?
+          if ([:json, :xml] & accepting_formats.keys).empty?
+            request.env['rack-accept.formats'] = {:json=>0}
+          end
           @media_type = (accepting_formats.has_key?(:xml) ? [:xml, accepting_formats[:xml]]
: nil)
         end if Deltacloud.respond_to? :default_frontend
 


Mime
View raw message