nextcloud-node-client icon indicating copy to clipboard operation
nextcloud-node-client copied to clipboard

Incorrect/missing URL encoding

Open BigMo opened this issue 5 years ago • 1 comments

Describe the bug Methods such as client.getFolderContents fail to generate properly URL encoded requests, resulting in HTTP 500 responses.

To Reproduce Steps to reproduce the behavior:

  1. Create a folder or file containing umlauts (ä, ö, ü...) or certain characters with special meanings in URLs (e.g. '+')
  2. Try to query this folder using methods such as client.getFolderContents

Expected behavior The API is supposed to generate properly encoded URLs for HTTP requests to the nextcloud instance, resulting in appropiate and expected HTTP responses. For client.getFolderContents, a list of folder contents of the specified folder should be returned.

Additional context Pulled this lib directly from NPM, version according to package.json is 1.8.1.

BigMo avatar Dec 23 '20 12:12 BigMo

Thanks for sending the error.

HttpClient.getHttpResponse(...) url is never url encoded

  • encode url in httpClient only
  • add tests with umlauts, #, ?,&,=

Try to get a create a new version by end of the year

hobigo avatar Dec 23 '20 14:12 hobigo