-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added a file size limit for upload. #143
Conversation
src/protocol/creation/routes.rs
Outdated
@@ -89,6 +89,13 @@ pub async fn create_file( | |||
} | |||
} | |||
|
|||
if let Some(max_file_size) = state.config.max_file_size { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. check pls
src/protocol/creation/routes.rs
Outdated
@@ -89,6 +89,13 @@ pub async fn create_file( | |||
} | |||
} | |||
|
|||
if let Some(max_file_size) = state.config.max_file_size { |
There was a problem hiding this comment.
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 {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.