actix-extras
actix-extras copied to clipboard
Allow testing created `Cors` instance
Creating a Cors middleware requires configuration in some cases. That needs testing.
However, it is pretty hard to test a created Cors instance as it doesn't expose its values.
Expected Behavior
Be able to test a Cors instance for its values.
Current Behavior
Not possible. It is possible to render a debug string of the struct, however as it uses HashSet with RandomStates, instances containing HashSet values can't be tested.
Possible Solution
Have Cors implement PartialEq. Or allow access to the values of its Inner.
Steps to Reproduce (for bugs)
- Set up a
Corsinstance - Try to test it.
Context
Your Environment
- Rust Version (I.e, output of
rustc -V): - Actix-* crate(s) Version: