From f9b0870da9ed5f5455789e70e9d57ac32294cab2 Mon Sep 17 00:00:00 2001 From: Aaron Lampros Date: Fri, 10 Nov 2017 13:59:54 -0500 Subject: [PATCH] Develop: use req.path to check for static files (#2876) Allows for query parameters to passed on to static files. Fix for #1655 --- packages/gatsby/src/commands/develop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby/src/commands/develop.js b/packages/gatsby/src/commands/develop.js index 0e246b391ddd3..673c56f8d22c6 100644 --- a/packages/gatsby/src/commands/develop.js +++ b/packages/gatsby/src/commands/develop.js @@ -114,7 +114,7 @@ async function startServer(program) { app.get(`*`, (req, res, next) => { // Load file but ignore errors. res.sendFile( - directoryPath(`/public/${decodeURIComponent(req.url)}`), + directoryPath(`/public${decodeURIComponent(req.path)}`), err => { // No err so a file was sent successfully. if (!err || !err.path) {