Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUBY-783 close security issue in cookie handling
- Loading branch information
Showing
2 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper')) | ||
require 'ostruct' | ||
|
||
class NewRelic::Agent::TransactionInfoTest < Test::Unit::TestCase | ||
def setup | ||
@request = OpenStruct.new(:cookies => {'NRAGENT' => 'tk=1234<tag>evil</tag>5678'}) | ||
end | ||
|
||
def test_get_token_gets_sanitized_token_from_cookie | ||
assert_equal('1234<tag>evil</tag>5678', | ||
NewRelic::Agent::TransactionInfo.get_token(@request)) | ||
end | ||
end |