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

Stricter options #101

Merged
merged 3 commits into from
Nov 24, 2020
Merged

Stricter options #101

merged 3 commits into from
Nov 24, 2020

Conversation

codyzu
Copy link
Contributor

@codyzu codyzu commented Nov 23, 2020

Checklist

This PR makes aligns the implementation with the documentation of the origin option:

  • any value of the origin option or return value of an origin function that is falsy but not false, results in an error
  • a non false falsy value is not defined in the documentation, and will now be considered an error
  • this aligns the behavior if origin is a value or a function
  • before a falsy value of the origin option disabled CORS, but a falsy non false return value of an origin function set the allowed origin to * (any origin)

This is a follow-up PR to #99 . This PR allowed #99 to only refactor and not change functionality.

@codyzu codyzu marked this pull request as ready for review November 23, 2020 15:16
@codyzu
Copy link
Contributor Author

codyzu commented Nov 23, 2020

@mcollina this should be the last PR to improve the maintainability of this module

index.js Show resolved Hide resolved
Copy link
Member

@zekth zekth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 8340081 into fastify:master Nov 24, 2020
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

Successfully merging this pull request may close these issues.

3 participants