Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GenerateRandomKey: do not swallow errors
The requirement to check for nil returns is so unexpected that even other Gorilla libraries get it wrong: <https://github.com/gorilla/sessions/blob/3eed1c4ffcde6f23b6f88068c63c1ef6190df331/store.go#L225> Since a malfunction of the system random number generator is pretty unrecoverable for most security-sensitive applications, I consider it fine to use a panic here. Most callers will have no better option than to just die anyway. If callers need a more specific behavior, they can implement these three lines of code themselves with application-specific error handling.
- Loading branch information