forked from arthurnn/memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
show_backtraces: false
leaking Exception#cause
This code was likely fine back when it was written against Ruby 1.9.3, but since then `Kernel#raise` now automatically attach the currently rescued error as the new exception `cause`. Since this code was re-raising the same instance over and once a `cause` was attached it would never be de-associated, which in some contrived scenario could leak to information leak across requests / test etc. I ran a benchmark and the fastest way to raise exception I could find is: ```ruby raise ErrorClass, "message".freeze, EMPTY_ARRAY, cause: nil ```
- Loading branch information
Showing
3 changed files
with
32 additions
and
28 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
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