Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCat committed Jun 13, 2021
1 parent 41c5d03 commit b96b74e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/WebServerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ export class WebServerManager {
}

private requestListener(req: http.IncomingMessage, res: http.ServerResponse): void {
if (req.url.startsWith("/files")) return this.fileListing(req.url, res) // TODO CHECK
if (req.url.startsWith("/files")) return this.fileListing(req.url, res)
this.requestsManager.getRequest(req, res)
}

private fileListing(url: string, res: http.ServerResponse): void {
if (url.includes("?")) url = url.split("?")[0]

const filePath = path.join(StorageHelper.updatesDir, url)
const filePath = path.join(StorageHelper.updatesDir, url.slice(6))

if (!fs.existsSync(filePath)) {
res.writeHead(404)
Expand Down

0 comments on commit b96b74e

Please sign in to comment.