"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "actionpack/test/controller/http_token_authentication_test.rb" between
rails-6.1.3.2.tar.gz and rails-6.1.4.tar.gz

About: Ruby on Rails is a web application development framework (written in Ruby).

http_token_authentication_test.rb  (rails-6.1.3.2):http_token_authentication_test.rb  (rails-6.1.4)
skipping to change at line 92 skipping to change at line 92
test "authentication request with badly formatted header" do test "authentication request with badly formatted header" do
@request.env["HTTP_AUTHORIZATION"] = 'Token token$"lifo"' @request.env["HTTP_AUTHORIZATION"] = 'Token token$"lifo"'
get :index get :index
assert_response :unauthorized assert_response :unauthorized
assert_equal "HTTP Token: Access denied.\n", @response.body, "Authentication header was not properly parsed" assert_equal "HTTP Token: Access denied.\n", @response.body, "Authentication header was not properly parsed"
end end
test "authentication request with evil header" do test "authentication request with evil header" do
@request.env["HTTP_AUTHORIZATION"] = "Token ." + " " * (1024*80-8) + "." @request.env["HTTP_AUTHORIZATION"] = "Token ." + " " * (1024 * 80 - 8) + "."
Timeout.timeout(1) do Timeout.timeout(1) do
get :index get :index
end end
assert_response :unauthorized assert_response :unauthorized
assert_equal "HTTP Token: Access denied.\n", @response.body, "Authentication header was not properly parsed" assert_equal "HTTP Token: Access denied.\n", @response.body, "Authentication header was not properly parsed"
end end
test "successful authentication request with Bearer instead of Token" do test "successful authentication request with Bearer instead of Token" do
@request.env["HTTP_AUTHORIZATION"] = "Bearer lifo" @request.env["HTTP_AUTHORIZATION"] = "Bearer lifo"
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)