diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-06-18 15:18:23 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-06-19 14:14:14 +0100 |
commit | 610b42456634c6194d219878f977c4c7e4c7cae3 (patch) | |
tree | 614f7f3e53b7afc11efe0a644b2f5372b7c3c314 | |
parent | a79349eb1fc51f0af1f3087b7c005e37b7133fc6 (diff) |
Use :platform to add rack-utf8_sanitizer
Unfortunately, the conditional used in 090531bf2d2b763e5bb281658e91b58905912130
results in `Gemfile.lock` being inconsistent with `Gemfile` under ruby 1.8.7 so
we can't use it until after Alaveteli release 0.22, which is the last release
that will support ruby 1.8.7.
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | config/application.rb | 2 | ||||
-rw-r--r-- | spec/integration/parameter_stripping_spec.rb | 2 |
3 files changed, 3 insertions, 5 deletions
@@ -23,9 +23,7 @@ gem 'net-http-local', '~> 0.1.2', :platforms => [:ruby_18, :ruby_19] gem 'net-purge', '~> 0.1.0' gem 'open4', '~> 1.3.4' gem 'rack', '~> 1.4.6' -if RUBY_VERSION.to_f >= 1.9 - gem 'rack-utf8_sanitizer', '~> 1.3.0' -end +gem 'rack-utf8_sanitizer', '~> 1.3.0', :platforms => :ruby_19 gem 'rake', '0.9.2.2' gem 'rails-i18n', '~> 0.7.3' gem 'recaptcha', '~> 0.3.1', :require => 'recaptcha/rails' diff --git a/config/application.rb b/config/application.rb index ed7488454..79784148f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -85,7 +85,7 @@ module Alaveteli config.middleware.insert_before ::ActionDispatch::Cookies, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true # Strip non-UTF-8 request parameters - if RUBY_VERSION.to_f >= 1.9 + if RUBY_VERSION == '1.9.3' config.middleware.insert 0, Rack::UTF8Sanitizer end diff --git a/spec/integration/parameter_stripping_spec.rb b/spec/integration/parameter_stripping_spec.rb index b910062a9..7e3c0adc2 100644 --- a/spec/integration/parameter_stripping_spec.rb +++ b/spec/integration/parameter_stripping_spec.rb @@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe "When handling bad requests" do - if RUBY_VERSION.to_f >= 1.9 + if RUBY_VERSION == '1.9.3' it 'should return a 404 for GET requests to a malformed request URL' do get 'request/228%85' |