mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05:00
🐛 Fix: fix a bug of file server when the request path is url encoded
This commit is contained in:
parent
c1698e8661
commit
48b13b20fe
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user