incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/4] Added params[:format] to allow set response type using query parameter
Date Tue, 24 Aug 2010 14:04:30 GMT
---
 server/lib/sinatra/respond_to.rb |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/server/lib/sinatra/respond_to.rb b/server/lib/sinatra/respond_to.rb
index f4704ea..f88c025 100644
--- a/server/lib/sinatra/respond_to.rb
+++ b/server/lib/sinatra/respond_to.rb
@@ -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
-- 
1.7.2


Mime
View raw message