You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community
is this issue currently blocking your project? (yes/no): No
is this issue affecting a production system? (yes/no): No
Context
node version: 14.1.0
module version with issue: 5.1.3 through 6.0.1
last module version without issue: 5.1.2
environment (e.g. node, browser, native): Node
used with (e.g. hapi application, another framework, standalone, ...): hapi
any other relevant information: I believe this regression was caused by 4514a5e
What are you trying to achieve or the steps to reproduce?
Trying to serve a directory based on an absolute path, as shown in the example below. Using the example, visiting / in the browser fails to render the directory listing. Visiting a subpath that is a file does work, such as /app.js. However, subpaths that are directories also fail to render their directory listing.
In the example, removing path.resolve() "fixes" the issue. Please note that, in my real app, I have path set to a function and the actual value is determined by some business logic that walks the filesystem and returns an absolute path.
A 500 Internal Server Error, which seems to be caused by inert joining an absolute path with another absolute path, resulting in a path that does not exist. For some reason, this doesn't happen on subpaths that are files.
What result did you expect?
The directory listing should be shown.
The text was updated successfully, but these errors were encountered:
sholladay
changed the title
Directory listings faill with a 500 when path is absolute
Directory listings fail with a 500 when path is absolute
Jul 2, 2020
Support plan
Context
What are you trying to achieve or the steps to reproduce?
Trying to serve a directory based on an absolute
path
, as shown in the example below. Using the example, visiting/
in the browser fails to render the directory listing. Visiting a subpath that is a file does work, such as/app.js
. However, subpaths that are directories also fail to render their directory listing.In the example, removing
path.resolve()
"fixes" the issue. Please note that, in my real app, I havepath
set to a function and the actual value is determined by some business logic that walks the filesystem and returns an absolute path.What was the result you got?
A 500 Internal Server Error, which seems to be caused by inert joining an absolute path with another absolute path, resulting in a path that does not exist. For some reason, this doesn't happen on subpaths that are files.
What result did you expect?
The directory listing should be shown.
The text was updated successfully, but these errors were encountered: