Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow testing created Cors instance #302

Open
ctron opened this issue Nov 11, 2022 · 0 comments
Open

Allow testing created Cors instance #302

ctron opened this issue Nov 11, 2022 · 0 comments

Comments

@ctron
Copy link

ctron commented Nov 11, 2022

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)

  1. Set up a Cors instance
  2. Try to test it.

Context

Your Environment

  • Rust Version (I.e, output of rustc -V):
  • Actix-* crate(s) Version:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant