corydolphin / flask-cors

Cross Origin Resource Sharing ( CORS ) support for Flask
https://flask-cors.corydolphin.com/
MIT License
867 stars 140 forks source link

Unknown keyword arguments silently ignored #324

Open Helveg opened 1 year ago

Helveg commented 1 year ago

When passing additional, or misspelled, keyword arguments to CORS, and probably elsewhere, they are silently ignored.

This means that a CORS(app, rigins=["mydomain.com"], send_wildcard=True) would produce false positive * wildcards for any domain.

Is there a design reason that leftover unknown keyword arguments can't be raised as an error?

corydolphin commented 1 year ago

Is there a design reason that leftover unknown keyword arguments can't be raised as an error?

I don't recall if this was an intentional decision I made adhering too closely to Postel's Law, or ease/laziness. Either way, I now feel strongly this was the wrong decision :-) Changing this to be explicit would be a big improvement, though may require a semver bump.

I'd love to see it happen, in addition to real, strict MyPy support for this project. I'd be happy to review contributions, and or grant access to the project to you or others to help accomplish this.

Helveg commented 1 year ago

Great, I've been on a bit of a type-hinting-bandwagon-spree lately so I'll see if I find time for this next weekend :) I'll make 2 separate PRs for it!