mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-01 16:39:38 +08:00
🐛 Fix: fix a bug of file server when the request path is url encoded
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user