mirror of https://gitee.com/bigwinds/arangodb
Fixed regex to identify Windows absolute and relative pathes also
This commit is contained in:
parent
32b4f5de19
commit
89a11587b3
|
@ -304,7 +304,7 @@
|
|||
[ appInfo, mount ] );
|
||||
|
||||
utils.validateMount(mount);
|
||||
if (/^((\/)|(\.\/)|(\.\.\/))/.test(appInfo)) {
|
||||
if (utils.pathRegex.test(appInfo)) {
|
||||
appInfo = moveAppToServer(appInfo);
|
||||
}
|
||||
var res;
|
||||
|
|
|
@ -41,6 +41,7 @@ var ArangoError = arangodb.ArangoError;
|
|||
var mountRegEx = /^(\/[a-zA-Z0-9_\-%]+)+$/;
|
||||
var mountAppRegEx = /\/APP(\/|$)/i;
|
||||
var mountNumberRegEx = /^\/[\d\-%]/;
|
||||
var pathRegex = /^((\.{0,2}(\/|\\))|(~\/)|[a-zA-Z]:\\)/;
|
||||
|
||||
var getStorage = function() {
|
||||
"use strict";
|
||||
|
@ -487,6 +488,7 @@ exports.validateMount = validateMount;
|
|||
exports.typeToRegex = typeToRegex;
|
||||
exports.zipDirectory = zipDirectory;
|
||||
exports.getStorage = getStorage;
|
||||
exports.pathRegex = pathRegex;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
|
|
|
@ -720,7 +720,7 @@
|
|||
installAppFromRemote(buildGithubUrl(appInfo), targetPath);
|
||||
} else if (/^https?:/i.test(appInfo)) {
|
||||
installAppFromRemote(appInfo, targetPath);
|
||||
} else if (/^((\/)|(\.\/)|(\.\.\/))/.test(appInfo)) {
|
||||
} else if (utils.pathRegex.test(appInfo)) {
|
||||
installAppFromLocal(appInfo, targetPath);
|
||||
} else if (/^uploads\/tmp-/.test(appInfo)) {
|
||||
// Install from upload API
|
||||
|
|
Loading…
Reference in New Issue