Skip to content

Commit

Permalink
Fix server when there is a dot in the path (#2429)
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Dec 18, 2018
1 parent 29dca2f commit bef1452
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/core/integration-tests/test/server.js
Expand Up @@ -217,6 +217,19 @@ describe('server', function() {
);
});

it('should work with paths that contain a dot', async function() {
let b = bundler(path.join(__dirname, '/integration/html/index.html'), {
publicUrl: '/'
});
server = await b.serve(0);

let data = await get('/bar.baz');
assert.equal(
data,
await fs.readFile(path.join(__dirname, '/dist/index.html'), 'utf8')
);
});

it('should not log dev server access for log level <= 3', async function() {
let b = bundler(path.join(__dirname, '/integration/html/index.html'), {
publicUrl: '/'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/Server.js
Expand Up @@ -63,7 +63,7 @@ function middleware(bundler) {
} else {
// Otherwise, serve the file from the dist folder
req.url = pathname.slice(bundler.options.publicURL.length);
return serve(req, res, send404);
return serve(req, res, sendIndex);
}
}

Expand Down

0 comments on commit bef1452

Please sign in to comment.