removed starting - of filenames
This commit is contained in:
parent
147932c454
commit
385cb0c73f
|
|
@ -259,6 +259,10 @@ module.exports = {
|
|||
// replace all the slashes and if the url is too long
|
||||
// cut it and add a small md5
|
||||
name = urlComponents.pathname.replace(/\//g, '-');
|
||||
if (name.lastIndexOf('-', 0) === 0) {
|
||||
name = name.slice(1, name.length);
|
||||
}
|
||||
|
||||
if (name.length > lengthBeforeCut) {
|
||||
name = name.slice(0, lengthBeforeCut);
|
||||
name = name + crypto.createHash('md5').update(u).digest('hex').substr(0, 5);
|
||||
|
|
@ -454,7 +458,5 @@ module.exports = {
|
|||
} else {
|
||||
return key + '.';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue