Skip to content
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

Preserve trailing slash in file path where it makes sense #268

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

yagehu
Copy link
Contributor

@yagehu yagehu commented Jun 8, 2024

This commit fixes the behavior of path_open such that if the path contains trailing slashes and the target file is not a directory, the call errors. This behavior is consistent with Linux host, Wasmtime, WAMR, and WasmEdge.

fixes #267

@yagehu yagehu changed the title Preserve trailing slash in file path Preserve trailing slash in file path where it makes sense Jun 8, 2024
@yagehu yagehu force-pushed the trailing-slash branch 5 times, most recently from 408d98b to 24348b8 Compare June 8, 2024 17:54
@yagehu yagehu changed the title Preserve trailing slash in file path where it makes sense [Draft] Preserve trailing slash in file path where it makes sense Jun 8, 2024
@yagehu yagehu force-pushed the trailing-slash branch 2 times, most recently from 6bac726 to 9d5c862 Compare June 8, 2024 18:11
This commit fixes the behavior of `path_open` such that if the path
contains trailing slashes and the target file is not a directory, the
call errors. This behavior is consistent with Linux host, Wasmtime,
WAMR, and WasmEdge.

fixes nodejs#267

Signed-off-by: Yage Hu <me@huyage.dev>
@yagehu yagehu changed the title [Draft] Preserve trailing slash in file path where it makes sense Preserve trailing slash in file path where it makes sense Jun 8, 2024
@guybedford
Copy link
Contributor

It would be good to align with implementations on these errors, and given the current architecture handling it in the path normalization seems a good way to go about it.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson mhdawson merged commit afffaaa into nodejs:main Jun 10, 2024
7 checks passed
@yagehu yagehu deleted the trailing-slash branch October 19, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

path_open does not respect trailing slashes
3 participants