Add startup validation for MaxUploadBytes > 0 #62
Labels
No labels
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IUS/once#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue Summary
Currently, there is no startup validation that
MaxUploadBytesis a positive integer. If an operator setsMaxUploadBytes = 0in the config, all uploads will fail silently without clear error messaging.Problem
MaxUploadBytes = 0, thehttp.MaxBytesReaderwill enforce a 0-byte limit, causing all uploads to fail with a 413 errorProposed Solution
Add a startup validation check in the config loading phase:
Related Issues
Testing
Should verify:
MaxUploadBytes = 0triggers warning and defaults to 100MBMaxUploadBytes = -1triggers warning and defaults to 100MBMaxUploadBytes = 50000000does not trigger warningPriority
Low (enhancement, no security impact)
✅ Implementation Complete & Opus-Reviewed
Status: Merged to master (commit
94bf449)Implementation Summary
What was done:
Validate()method to config.Opts with sensible defaultsTest Results:
Opus Code Review Findings
Verdict: ✅ APPROVED (with documentation enhancements)
Strengths:
Improvements Made:
Files Changed
v2/cmd/once-server/config/main.go: Added Validate() methodv2/cmd/once-server/config/main_test.go: 14 new test casesv2/cmd/once-server/main.go: Integrated validation at startupReady to Close
✅ Implemented
✅ Tested (184 total tests passing)
✅ Merged to master
✅ Opus-reviewed and approved
(co)authored by ai:claude-sonnet-4-5