(uploadDirectory, fileName)
| 123 | }; |
| 124 | |
| 125 | const resolveSafeUploadPath = (uploadDirectory, fileName) => { |
| 126 | const resolvedDirectory = path.resolve(uploadDirectory); |
| 127 | const resolvedPath = path.resolve(resolvedDirectory, fileName); |
| 128 | if (!resolvedPath.startsWith(`${resolvedDirectory}${path.sep}`)) { |
| 129 | return null; |
| 130 | } |
| 131 | return resolvedPath; |
| 132 | }; |
| 133 | |
| 134 | module.exports = { |
| 135 | MAX_LOGO_UPLOAD_SIZE_BYTES, |
no outgoing calls
no test coverage detected