aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-12-22 11:38:49 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-22 11:38:49 +0000
commite822e7091e7e0153a68094898847b0793e58dedd (patch)
tree42b9f4f21e30e56e6545f574a248419fb00ff679
parent9de1d6b71ee0d9785631222e5619691da692fcb9 (diff)
Revert "Use rack-utf8_sanitizer gem"
This reverts commit 45f25290e2e4a1f33ec5d3df6ecfb40300318ece. Use of the :ruby_20 platform requires bundler 1.3, which is not available on all our supported OSes as a package. See https://github.com/mysociety/alaveteli/issues/1276 for details.
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock5
-rw-r--r--config/application.rb4
-rw-r--r--spec/integration/errors_spec.rb14
4 files changed, 8 insertions, 16 deletions
diff --git a/Gemfile b/Gemfile
index a6315ea04..f5bb0ef97 100644
--- a/Gemfile
+++ b/Gemfile
@@ -22,7 +22,6 @@ gem 'memcache-client'
gem 'net-http-local', :platforms => [:ruby_18, :ruby_19]
gem 'net-purge'
gem 'rack'
-gem 'rack-utf8_sanitizer', :platforms => [:ruby_19, :ruby_20, :ruby_21]
gem 'rake', '0.9.2.2'
gem 'rails-i18n'
gem 'recaptcha', '~> 0.3.1', :require => 'recaptcha/rails'
diff --git a/Gemfile.lock b/Gemfile.lock
index ffb2286ce..3e640ad77 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -183,10 +183,6 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
- rack-utf8_sanitizer (1.2.3)
- bundler (~> 1.0)
- rack (~> 1.0)
- railties (= 3.2.21)
rails (3.2.21)
actionmailer (= 3.2.21)
actionpack (= 3.2.21)
@@ -330,7 +326,6 @@ DEPENDENCIES
pg
quiet_assets
rack
- rack-utf8_sanitizer
rails (= 3.2.21)
rails-i18n
rake (= 0.9.2.2)
diff --git a/config/application.rb b/config/application.rb
index ff72df015..ed4f07819 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -74,10 +74,6 @@ module Alaveteli
ENV['RECAPTCHA_PUBLIC_KEY'] = ::AlaveteliConfiguration::recaptcha_public_key
ENV['RECAPTCHA_PRIVATE_KEY'] = ::AlaveteliConfiguration::recaptcha_private_key
- if RUBY_VERSION.to_f >= 1.9
- config.middleware.insert 0, Rack::UTF8Sanitizer
- end
-
# Insert a bit of middleware code to prevent uneeded cookie setting.
require "#{Rails.root}/lib/whatdotheyknow/strip_empty_sessions"
config.middleware.insert_before ::ActionDispatch::Cookies, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true
diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb
index a28b34da6..39f1279ce 100644
--- a/spec/integration/errors_spec.rb
+++ b/spec/integration/errors_spec.rb
@@ -61,12 +61,14 @@ describe "When errors occur" do
response.body.should match("Sorry, we couldn't find that page")
end
- it 'should handle non utf-8 parameters' do
- get ('/%d3')
- response.should render_template('general/exception_caught')
- response.code.should == '404'
- response.body.should match("Sorry, we couldn't find that page")
- end
+ # it 'should handle non utf-8 parameters' do
+ # pending 'until we sanitize non utf-8 parameters for Ruby >= 1.9' do
+ # get ('/%d3')
+ # response.should render_template('general/exception_caught')
+ # response.code.should == '404'
+ # response.body.should match("Sorry, we couldn't find that page")
+ # end
+ # end
it "should render a 500 for general errors using the general/exception_caught template" do