slower 1.1.26 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/router.js +3 -3
- package/package.json +1 -1
package/lib/router.js
CHANGED
|
@@ -128,7 +128,7 @@ class SlowerRouter {
|
|
|
128
128
|
let data, targetFile, extension, targetMime, targetEncoding;
|
|
129
129
|
if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) {
|
|
130
130
|
targetFile = file.replace(/\//gim, '\\');
|
|
131
|
-
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.
|
|
131
|
+
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.split('/').slice(-1)[0];
|
|
132
132
|
} else {
|
|
133
133
|
targetFile = ((file == '' || !file) ? req.url : file);
|
|
134
134
|
}
|
|
@@ -172,7 +172,7 @@ class SlowerRouter {
|
|
|
172
172
|
let data, targetFile, extension, targetMime, targetEncoding;
|
|
173
173
|
if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) {
|
|
174
174
|
targetFile = file.replace(/\//gim, '\\');
|
|
175
|
-
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.
|
|
175
|
+
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.split('/').slice(-1)[0];
|
|
176
176
|
} else {
|
|
177
177
|
targetFile = ((file == '' || !file) ? req.url : file);
|
|
178
178
|
}
|
|
@@ -238,7 +238,7 @@ class SlowerRouter {
|
|
|
238
238
|
let data, targetFile, extension, targetMime, targetEncoding;
|
|
239
239
|
if (fs.existsSync(file) && fs.lstatSync(file).isDirectory()) {
|
|
240
240
|
targetFile = file.replace(/\//gim, '\\');
|
|
241
|
-
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.
|
|
241
|
+
targetFile = ((targetFile.endsWith('\\')) ? targetFile : targetFile+'\\') + req.url.split('/').slice(-1)[0];
|
|
242
242
|
} else {
|
|
243
243
|
targetFile = ((file == '' || !file) ? req.url : file);
|
|
244
244
|
}
|