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

readdir includes parent path name when not mounted on root #84

Open
Cobertos opened this issue Jun 6, 2022 · 4 comments
Open

readdir includes parent path name when not mounted on root #84

Cobertos opened this issue Jun 6, 2022 · 4 comments

Comments

@Cobertos
Copy link

Cobertos commented Jun 6, 2022

When pairing readdir with cors-anywhere, I seem to be getting unexpected results. It's the same behavior as #56 but it only happens when I proxy requests through cors-anywhere.

I modified the repo in #56 to produce the unexpected results. You can find the reproduction in https://github.com/Cobertos/webdav-fs

npm install
node server_webdav.js &
node client_webdav.js
@Cobertos Cobertos changed the title readdir includes parent path name, but only when using cors-anywhere readdir includes parent path name when not mounted on root Jun 8, 2022
@Cobertos
Copy link
Author

Cobertos commented Jun 8, 2022

It seems that this is occurs without cors-anywhere, you just have to mount the webdav server not on the root domain, but on a path of it.

I updated the repro with a server mounted on /somewhere and it exhibits the same behavior as #56

@perry-mitchell
Copy link
Owner

Thanks for this! Unfortunately I don't have time right now to dig into it, but have you checked if your issue is reproducible on the parent webdav project?

I'd also happily accept a PR addressing this.

@Cobertos
Copy link
Author

Yes, it does look like it happens with the parent repo. I pushed a commit to use webdav and .getDirectoryContents() directly and I see the duplicated entry

I will take a stab at a PR

@Cobertos
Copy link
Author

Made a PR, see perry-mitchell/webdav-client#324 . Turns out it was not where I mounted the webdav server, but just that my calls were not using the leading /, like all the ones in the webdav-client repo tests are.

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

No branches or pull requests

2 participants