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

Added a file size limit for upload. #143

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

CiceronRiman
Copy link
Contributor

No description provided.

@@ -89,6 +89,13 @@ pub async fn create_file(
}
}

if let Some(max_file_size) = state.config.max_file_size {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you please move it below check that length is not None; Under the line 120.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. check pls

@@ -89,6 +89,13 @@ pub async fn create_file(
}
}

if let Some(max_file_size) = state.config.max_file_size {
Copy link
Owner

Choose a reason for hiding this comment

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

Also, it can be rewritten a bit to make it look nicer.

if state.config.max_file_size.is_some() && state.config.max_file_size < length {
   ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@s3rius s3rius merged commit 4a21931 into s3rius:develop Oct 19, 2023
4 checks 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