-
Notifications
You must be signed in to change notification settings - Fork 360
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
Local adapter clean user input before file access #1037
Conversation
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.
Great, thanks! Hope this LGTMs :-)
Codecov Report
@@ Coverage Diff @@
## master #1037 +/- ##
==========================================
+ Coverage 46.86% 46.99% +0.12%
==========================================
Files 179 182 +3
Lines 14069 14301 +232
==========================================
+ Hits 6594 6721 +127
- Misses 6607 6686 +79
- Partials 868 894 +26
Continue to review full report at Codecov.
|
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.
Thanks!
block/local/adapter.go
Outdated
func isValidUploadID(uploadID string) bool { | ||
_, err := strconv.ParseUint(uploadID, 16, 64) | ||
return err != nil | ||
} |
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.
Consider returning error
, and then using this error message to wrap ErrInvalidUploadIDFormat
. That might give the caller more information about what went wrong.
This change is