You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ra...@gmail.com on 2010/12/10 12:46:23 UTC
[PATCH core] On server/lib/sinatra/rabbit.rb: Fixed the variable declaration in a more ruby way On server/server.rb: Fixed on line 72 the redirect, because it's a permanent redirect and not a 302.
From: Francesco Vollero <fr...@gmail.com>
---
server/lib/sinatra/rabbit.rb | 2 +-
server/server.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
index 05bd6c5..e843366 100644
--- a/server/lib/sinatra/rabbit.rb
+++ b/server/lib/sinatra/rabbit.rb
@@ -72,7 +72,7 @@ module Sinatra
end
def path(args = {})
- l_prefix = args[:prefix] ? args[:prefix] : prefix
+ l_prefix = args[:prefix] || prefix
if @member
if standard?
"#{l_prefix}/#{@collection.name}/:id"
diff --git a/server/server.rb b/server/server.rb
index 9585f9b..6b446ba 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -69,7 +69,7 @@ end
Sinatra::Application.register Sinatra::RespondTo
# Redirect to /api
-get '/' do redirect url_for('/api'); end
+get '/' do redirect url_for('/api'), 301; end
get '/api/drivers\/?' do
respond_to do |format|
--
1.7.3.3
Re: [PATCH core] On server/lib/sinatra/rabbit.rb: Fixed the
variable declaration in a more ruby way On server/server.rb: Fixed on line
72 the redirect, because it's a permanent redirect and not a 302.
Posted by Michal Fojtik <mf...@redhat.com>.
On 10/12/10 12:46 +0100, razorinc@gmail.com wrote:
>From: Francesco Vollero <fr...@gmail.com>
Good catch Francesco, ACK.
>
>---
> server/lib/sinatra/rabbit.rb | 2 +-
> server/server.rb | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
>index 05bd6c5..e843366 100644
>--- a/server/lib/sinatra/rabbit.rb
>+++ b/server/lib/sinatra/rabbit.rb
>@@ -72,7 +72,7 @@ module Sinatra
> end
>
> def path(args = {})
>- l_prefix = args[:prefix] ? args[:prefix] : prefix
>+ l_prefix = args[:prefix] || prefix
> if @member
> if standard?
> "#{l_prefix}/#{@collection.name}/:id"
>diff --git a/server/server.rb b/server/server.rb
>index 9585f9b..6b446ba 100644
>--- a/server/server.rb
>+++ b/server/server.rb
>@@ -69,7 +69,7 @@ end
> Sinatra::Application.register Sinatra::RespondTo
>
> # Redirect to /api
>-get '/' do redirect url_for('/api'); end
>+get '/' do redirect url_for('/api'), 301; end
>
> get '/api/drivers\/?' do
> respond_to do |format|
>--
>1.7.3.3
>
--
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org
--------------------------------------------------------