-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(http/file_server): dealing with dir listing view that contain system files #3371
Conversation
stdout: "piped", | ||
stderr: "null", | ||
stderr: "inherit", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this line will make debugging easier as error messages will be displayed instead of discarded. It was a minor change so I've included it in this PR.
http/file_server.ts
Outdated
} | ||
|
||
return createCommonResponse(Status.NotFound); | ||
} | ||
|
||
function logError(error: unknown) { | ||
console.error( | ||
red(error instanceof Error ? error.message : "[non-error thrown]"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly related to this change, but "[non-error thrown]"
message doesn't look useful. How about just printing error
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. It has changed! (d8137cb)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
close #3141
When I launch a file server in the Windows root directory and access http://localhost:4507/, I get a 500 Internal Server Error.
It seems that the following error occurs internally. These are Windows system files that reject
Deno.stat
calls.This PR adds a try-catch around the
![image](https://user-images.githubusercontent.com/40050810/236688379-b9c0ca89-4445-4318-93ef-50f4a32a23d3.png)
Deno.stat
call so that directory listing views are generated even for directories containing system files.After this PR, the display of the root directory page looks like this: