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

Nextcloud Folder List - Incorrect path #8802

Open
opcod3 opened this issue Mar 4, 2024 · 2 comments
Open

Nextcloud Folder List - Incorrect path #8802

opcod3 opened this issue Mar 4, 2024 · 2 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@opcod3
Copy link

opcod3 commented Mar 4, 2024

Bug Description

When using the nextcloud 'List Folders' integration the path for the returned items is incorrect.

The issue occurs when nextcloud is hosted at the root of a domain (the recommended configuration), instead of at domain.com/nextcloud

The issue likely occurs because of this statement:

newItem.path = item['d:href'].slice(19);

This works fine if nextcloud is hosted at [domain]/nextcloud but breaks it it's hosted at [domain].

Ideally the user should also be stripped from the returned path if it's present in the WebDAV url, this would allow piping the path directly into a delete file/folder node without having to manually strip the user first.

To Reproduce

  1. Setup nextcloud credentials pointing to a nextcloud instance which is hosted on the root path of a domain
  2. Set WebDAV path to https://[redacted-domain]/remote.php/dav/files/MyUser
  3. Use the nextcloud node to get a list of directories at any path e.g. /
  4. The paths of the resulting files and directories will all be prefixed with es/MyUser

Expected behavior

If:

  • WebDAV URL: https://[redacted-domain]/remote.php/dav/files/MyUser
  • List Path: /
  • Returned Folder path: es/MyUser/TestFolder
  • Expected path: /TestFolder

If (Assumed behavior but not actually tested):

  • WebDAV URL: https://[redacted-domain]/remote.php/dav/files
  • List Path: /MyUser/
  • Returned Folder path: es/MyUser/TestFolder
  • Expected path: /MyUser/TestFolder

Operating System

Docker

n8n Version

1.29.1

Node.js Version

irrelevant

Database

PostgreSQL

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Mar 6, 2024

Hey @opcod3,

Thanks for the report, I have created NODE-1215 as the dev ticket to get this fixed.

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Mar 6, 2024
@datdamnzotz
Copy link

n8n v1.31.2 has the same issue.
my usernames are url encoded so they look like

https://example.com/cloud/remote.php/dav/files/test%40example.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

3 participants