-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Safe default filename #689
Merged
Merged
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
777a04f
feat: allow to use filename option without keepExtension
GrosSacASac 5531a57
feat: can use uploadDir option and filename together
GrosSacASac 33dd6c4
refactor: rename
GrosSacASac ebb7a18
feat: by default prevent directory traversal attacks
GrosSacASac cb3d359
refactor: make octet stream less divergent
GrosSacASac aafebea
refactor: pass through, avoid renaming variable names
GrosSacASac 0a5bad4
refactor: prefer Object.assign
GrosSacASac 032e66b
feat: pass newName
GrosSacASac ad1664a
feat: give createFileWriteStream more, including newName
GrosSacASac c178080
docs: update
GrosSacASac f600f32
docs: update examples
GrosSacASac 3ca6382
fix: fix missing variables
GrosSacASac df66b4f
feat: remove duplicate fix tests
GrosSacASac e0576e1
lint: lint
GrosSacASac 59a9b2b
refactor: rename mime into mimetype
GrosSacASac 2ca0b78
refactor: explicit this.options.keepExtensions !== true
GrosSacASac e4b7fe6
tests: reverse expectation order
GrosSacASac 3481057
tests: rename to xname to avoid confusion
GrosSacASac bef35f2
refactor: inline old _uploadPath
GrosSacASac 45c9213
refactor: rename newName into newFileName
GrosSacASac 7edf4bb
refactor: rename filename into originalFilename
GrosSacASac 8340df2
refactor: direcly filepath
GrosSacASac 63402a1
fix: test
GrosSacASac 9e54b19
refactor: split hash into hashAlgorithm and hash
GrosSacASac 4f09883
feat: this.lastModifiedDate = null remains
GrosSacASac 2d85616
refactor: finalpath: filepath
GrosSacASac 48f25fc
fix: change order
GrosSacASac 3c14493
refactor: better be explicit
GrosSacASac 58e4a61
feat: display more in toString
GrosSacASac 4ff8447
docs: update changelog
GrosSacASac fec82d3
chore: update version
GrosSacASac 738ff5c
Merge branch 'master' into safe-default-filename
GrosSacASac 4bce5f7
fix: revert, renamed too much
GrosSacASac 97181fe
fix: _flush is more appropriate
GrosSacASac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* eslint-disable no-plusplus */ | ||
|
||
|
||
const missingPlugin = 1000; | ||
const pluginFunction = 1001; | ||
const aborted = 1002; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
path
's return ofext
isn't handling well filenames with multiple dots, that's why i did the_getExtension
method, maybe use it here too.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.
but the problem is that there would be duplicated parts. For example x.y.z.w would call
this.options.filename.call(this, name, ext, part, this);
with name = 'x.y.z' and ext = '.y.z.w'