Commit c03c86ee authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by GitHub

Make sure /static/ and /_next/ are valid internal urls. (#2631)

parent 00e2659d
...@@ -171,12 +171,12 @@ export default class Server { ...@@ -171,12 +171,12 @@ export default class Server {
await renderScript(req, res, page, this.renderOpts) await renderScript(req, res, page, this.renderOpts)
}, },
'/_next/:path+': async (req, res, params) => { '/_next/:path?': async (req, res, params) => {
const p = join(__dirname, '..', 'client', ...(params.path || [])) const p = join(__dirname, '..', 'client', ...(params.path || []))
await this.serveStatic(req, res, p) await this.serveStatic(req, res, p)
}, },
'/static/:path+': async (req, res, params) => { '/static/:path?': async (req, res, params) => {
const p = join(this.dir, 'static', ...(params.path || [])) const p = join(this.dir, 'static', ...(params.path || []))
await this.serveStatic(req, res, p) await this.serveStatic(req, res, p)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment