Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBitz committed Oct 15, 2024
1 parent 8a1505f commit cb68ec9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ module.exports = async (request, response, config = {}, methods = {}) => {
if (err.code !== 'ENOENT') {
throw err;
}

// The requested symlink is invalid
return handlers.sendError(absolutePath, response, acceptsJSON, current, handlers, config, {
statusCode: 404,
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/symlinks/a-bad-link

This file was deleted.

1 change: 1 addition & 0 deletions test/fixtures/symlinks/a-bad-link
3 changes: 1 addition & 2 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,15 +1343,14 @@ test('allow symlinks by setting the option', async () => {
expect(text).toBe(spec);
});

test('A bad symlink should be a 404', async t => {
test('A bad symlink should be a 404', async () => {
const name = 'symlinks/a-bad-link';

const url = await getUrl({
symlinks: true
});

const response = await fetch(`${url}/${name}`);

expect(response.status).toBe(404);

const text = await response.text();
Expand Down

0 comments on commit cb68ec9

Please sign in to comment.