-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: better error message when the max upload size is exceeded #158
fix: better error message when the max upload size is exceeded #158
Conversation
Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
Thanks for making a pull request! 😃 |
Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
=======================================
Coverage 14.48% 14.48%
=======================================
Files 2 2
Lines 214 214
=======================================
Hits 31 31
Misses 179 179
Partials 4 4 ☔ View full report in Codecov by Sentry. |
@@ -53,6 +53,15 @@ func HandleCreateProjectInput(w http.ResponseWriter, r *http.Request, isCommon b | |||
} | |||
r.Body = http.MaxBytesReader(w, r.Body, common.Config.MaxUploadSize) | |||
if err := r.ParseMultipartForm(common.Config.MaxUploadSize); err != nil { | |||
if _, ok := err.(*http.MaxBytesError); ok { | |||
logrus.Errorf("request body exceeded max upload size of '%d' bytes. Error: %q", common.Config.MaxUploadSize, err) |
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.
Would it be good to mention which config to change?
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
…xceeded Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
…ze is exceeded Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
No description provided.