We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97ca067 commit 5e17faeCopy full SHA for 5e17fae
basic-dynamic-static-example/index.js
@@ -44,8 +44,9 @@ http.createServer((req, res) => {
44
res.writeHead(400);
45
res.end('NO');
46
} else {
47
- const extension = req.url.match(/\.([^.]+)$/);
48
- if (extension && staticExtensions.has(extension[1]) && req.url.match(/^[^./]+\.[^./]+$/)) {
+ const filename = req.url.match(/\/(.*)$/);
+ const extension = filename && filename[1].match(/\.([^.]+)$/);
49
+ if (extension && staticExtensions.has(extension[1]) && filename && filename[1].match(/^[^./]+\.[^./]+$/)) {
50
readFile(`.${req.url}`, (err, data) => {
51
if (err) {
52
if (err.code === 'ENOENT') {
0 commit comments