mirror of
https://github.com/redmine/redmine.git
synced 2026-01-06 15:42:57 +01:00
explicitly set encoding UTF-8 (#16107)
Default Ruby source file encoding changed in Ruby 2.0.0. https://bugs.ruby-lang.org/issues/6679 git-svn-id: http://svn.redmine.org/redmine/trunk@12918 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -41,8 +41,13 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base
|
||||
end
|
||||
|
||||
def test_invalid_utf8_credentials_should_not_trigger_an_error
|
||||
invalid_utf8 = "\x82"
|
||||
if invalid_utf8.respond_to?(:force_encoding)
|
||||
invalid_utf8.force_encoding('UTF-8')
|
||||
assert !invalid_utf8.valid_encoding?
|
||||
end
|
||||
assert_nothing_raised do
|
||||
get '/users/current.xml', {}, credentials("\x82", "foo")
|
||||
get '/users/current.xml', {}, credentials(invalid_utf8, "foo")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user