incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1000397 - /incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb
Date Thu, 23 Sep 2010 10:26:47 GMT
Author: mfojtik
Date: Thu Sep 23 10:26:47 2010
New Revision: 1000397

URL: http://svn.apache.org/viewvc?rev=1000397&view=rev
Log:
Added params[:format] to allow set response type using query parameter

Modified:
    incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb

Modified: incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb?rev=1000397&r1=1000396&r2=1000397&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb (original)
+++ incubator/deltacloud/trunk/server/lib/sinatra/respond_to.rb Thu Sep 23 10:26:47 2010
@@ -57,6 +57,9 @@ module Sinatra
             if ext
               @mime_types = [ Helpers::mime_type(ext) ]
               format ext
+            elsif (params[:format])
+              @mime_types = [Helpers::mime_type(params[:format])]
+              format params[:format]
             end
           end
         end



Mime
View raw message