Verify Container's name is a string
This commit is contained in:
parent
628be51429
commit
9597144422
|
@ -124,6 +124,8 @@ FileSystemProvider.prototype.getContainers = function(cb) {
|
|||
FileSystemProvider.prototype.createContainer = function(options, cb) {
|
||||
var self = this;
|
||||
var name = options.name;
|
||||
var hasSlash = (typeof name == 'string' ? name.search('%2F') : false);
|
||||
name = (hasSlash != -1 ? name.replace(/%2F/gi, '/') : name);
|
||||
var dir = path.join(this.root, name);
|
||||
validateName(name, cb) && fs.mkdir(dir, options, function(err) {
|
||||
if (err) {
|
||||
|
@ -180,12 +182,8 @@ FileSystemProvider.prototype.getContainer = function(containerName, cb) {
|
|||
// File related functions
|
||||
FileSystemProvider.prototype.upload = function(options, cb) {
|
||||
var container = options.container;
|
||||
if (!validateName(container)) {
|
||||
return writeStreamError(
|
||||
new Error(g.f('{{FileSystemProvider}}: Invalid name: %s', container)),
|
||||
cb
|
||||
);
|
||||
}
|
||||
var hasSlash = (typeof container == 'string' ? container.search('%2F') : false);
|
||||
container = (hasSlash != -1 ? container.replace(/%2F/gi, '/') : container);
|
||||
var file = options.remote;
|
||||
if (!validateName(file)) {
|
||||
return writeStreamError(
|
||||
|
|
Loading…
Reference in New Issue