You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/07/04 14:02:17 UTC

[PATCH] Addresses JIRA DTACLOUD_248 - frozen string 1.8 vs 1.9 ruby

From: marios <ma...@redhat.com>

Ruby 1.8 'gsub' on frozen string doesn't complain unless
the string is actually modified. In 1.9 things explode:
http://bugs.ruby-lang.org/issues/3200

https://issues.apache.org/jira/browse/DTACLOUD-248

Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/sinatra/rack_matrix_params.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/sinatra/rack_matrix_params.rb b/server/lib/sinatra/rack_matrix_params.rb
index 0d9339b..e999f89 100644
--- a/server/lib/sinatra/rack_matrix_params.rb
+++ b/server/lib/sinatra/rack_matrix_params.rb
@@ -92,7 +92,7 @@ module Rack
       else
         # For other methods it's more complicated
         if env['REQUEST_METHOD']!='POST' and not matrix_params.keys.empty?
-          env['QUERY_STRING'].gsub!(/;([^\/]*)/, '')
+          env['QUERY_STRING'] = env['QUERY_STRING'].gsub(/;([^\/]*)/, '')
           new_params = matrix_params.collect do |component, params|
             params.collect { |k,v| "#{component}[#{k}]=#{CGI::escape(v.to_s)}" }
           end.flatten
-- 
1.7.6.5


Re: [PATCH] Addresses JIRA DTACLOUD_248 - frozen string 1.8 vs 1.9 ruby

Posted by David Lutterkort <lu...@redhat.com>.
On Wed, 2012-07-04 at 15:02 +0300, marios@redhat.com wrote:
> From: marios <ma...@redhat.com>
> 
> Ruby 1.8 'gsub' on frozen string doesn't complain unless
> the string is actually modified. In 1.9 things explode:
> http://bugs.ruby-lang.org/issues/3200
> 
> https://issues.apache.org/jira/browse/DTACLOUD-248

ACK

David