Skip to content

Commit

Permalink
Filter session_id on secure requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinez87 committed Aug 25, 2011
1 parent 7700622 commit 31841ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
@@ -1,2 +1,2 @@
* session id: <%= raw @request.session['session_id'].inspect.html_safe %>
* session id: <%= @request.ssl? ? "[FILTERED]" : (raw @request.session['session_id'].inspect.html_safe) %>
* data: <%= raw PP.pp(@request.session, "") %>
13 changes: 13 additions & 0 deletions test/dummy/test/functional/posts_controller_test.rb
Expand Up @@ -56,4 +56,17 @@ class PostsControllerTest < ActionController::TestCase
assert @ignored_exception.class.inspect == "ActiveRecord::RecordNotFound"
assert_nil @ignored_mail
end

test "should filter session_id on secure requests" do
request.env['HTTPS'] = 'on'
begin
@post = posts(:one)
post :create, :post => @post.attributes
rescue => e
@secured_mail = ExceptionNotifier::Notifier.exception_notification(request.env, e)
end

assert request.ssl?
assert @secured_mail.body.include? "* session id: [FILTERED]\n *"
end
end

0 comments on commit 31841ed

Please sign in to comment.