fix bug in handleUserFiles
fix not detecting file, as originalUrl has no "/"
This commit is contained in:
parent
503b546470
commit
a2ef9e0e9f
@ -120,8 +120,8 @@ export const setup = function (router, con, server) {
|
|||||||
|| request.originalUrl.split("?").shift(); //backup in case anything goes wrong
|
|| request.originalUrl.split("?").shift(); //backup in case anything goes wrong
|
||||||
|
|
||||||
let path = ""
|
let path = ""
|
||||||
if (existsSync(dir + "views" + originalUrl)) {
|
if (existsSync(dir + "views/" + originalUrl)) {
|
||||||
path = dir + "views" + originalUrl
|
path = dir + "views/" + originalUrl
|
||||||
//send .txt files as plaintext to help browsers interpret it correctly
|
//send .txt files as plaintext to help browsers interpret it correctly
|
||||||
if(originalUrl.endsWith(".txt")) {
|
if(originalUrl.endsWith(".txt")) {
|
||||||
response.set('Content-Type', 'text/plain');
|
response.set('Content-Type', 'text/plain');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user