Skip to content

Commit

Permalink
🐛 Fix: fix a bug of file server when the request path is url encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Jul 18, 2023
1 parent c1698e8 commit 48b13b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/fileServer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const serverPort = 36699
export function startFileServer () {
const server = http.createServer((req, res) => {
const requestPath = req.url?.split('?')[0]
const filePath = path.join(imgFilePath, requestPath!)
const filePath = path.join(imgFilePath, decodeURIComponent(requestPath as string))

fs.readFile(filePath, (err, data) => {
if (err) {
Expand Down

0 comments on commit 48b13b2

Please sign in to comment.