MCPcopy
hub / github.com/node-formidable/formidable / _joinDirectoryName

Method _joinDirectoryName

src/Formidable.js:598–607  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

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';

Callers 2

_handlePartMethod · 0.95
initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected