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

Remove last Option<Vec.. from API. Fixes #2820 #2822

Merged
merged 5 commits into from Apr 21, 2023
Merged

Conversation

dessalines
Copy link
Member

The only Option<Vec<'s left, are the ones for create / edit API actions, which is correct because those should be optional.

&& !local_site_data
.allowed_instances
.iter()
.any(|i| domain.eq(&i.domain))
Copy link
Member

Choose a reason for hiding this comment

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

The is_empty check isnt necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd thought it wasn't but it fails otherwise. You can check the previous failed CI attempts for that.

Copy link
Member

Choose a reason for hiding this comment

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

I think you need to change it to if local_site_data.allowed_instances.iter().all(|i| domain.ne(&i.domain)) {

Copy link
Member Author

Choose a reason for hiding this comment

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

That would check to make sure every instance in that allowlist is the domain to be checked. We only want to see if the one to be checked is there or not.

Copy link
Member

Choose a reason for hiding this comment

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

Ah the is_empty is actually to check if allowlist mode is enabled, so it does require a separate check. Could you add a comment to explain that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Didnt get pushed?

@Nutomic Nutomic merged commit eb40aeb into main Apr 21, 2023
1 check passed
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.

None yet

2 participants