(name)
| 596 | } |
| 597 | |
| 598 | _joinDirectoryName(name) { |
| 599 | const newPath = path.join(this.uploadDir, name); |
| 600 | |
| 601 | // prevent directory traversal attacks |
| 602 | if (!newPath.startsWith(this.uploadDir)) { |
| 603 | return path.join(this.uploadDir, this.options.defaultInvalidName); |
| 604 | } |
| 605 | |
| 606 | return newPath; |
| 607 | } |
| 608 | |
| 609 | _setUpRename() { |
| 610 | const hasRename = typeof this.options.filename === 'function'; |
no outgoing calls
no test coverage detected