owncloud / owncloud/ocis

different url encoding pattern used in oc10 and ocis

Open
#4,676 2 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

different URL encoding patterns used in oc10 and ocis for resource names with spaces and brackets. In case of `oc10` for folder with name `foo (2)` such encoding is followed `/core/remote.php/webdav/Shares/foo%20(2)`, only the space is encoded not the brackets
In case of OCIS the brackets are encoded too `/remote.php/webdav/Shares/foo%20%282%29/`

## Steps to reproduce

Steps to reproduce the behavior:

1 .As einstein create a folder foo (1)
2. As user einstein `PROPFIND` files
```console
curl -u einstein:relativity -k -X PROPFIND 'https://host.docker.internal:9200/remote.php/dav/files/Einstein' | xmllint --format -
```

## Expected behavior

In case of `oc10` for a folder with the name `foo (1)` such encoding is followed `/core/remote.php/dav/files/Einstein/foo%20(1)/` only the space is encoded not the brackets

```console
curl -u einstein:relativity -k -X PROPFIND 'http://localhost/core/remote.php/dav/files/Einstein' | xmllint --format -
```

```console


/core/remote.php/dav/files/Einstein/


Thu, 29 Sep 2022 09:18:35 GMT



396
-3
"633562eb4da83"

HTTP/1.1 200 OK



/core/remote.php/dav/files/Einstein/.gitignore


Tue, 27 Sep 2022 06:04:12 GMT
396

"57ea655474caface856a93c9c1cff81e"
application/octet-stream

HTTP/1.1 200 OK



/core/remote.php/dav/files/Einstein/foo%20(1)/


Thu, 29 Sep 2022 09:18:35 GMT



0
-3
"633562eb48897"

HTTP/1.1 200 OK

```

## Actual behavior
In case of OCIS the brackets are encoded too `/remote.php/dav/files/Einstein/foo%20%281%29/`

```console
curl -u einstein:relativity -k -X PROPFIND 'https://host.docker.internal:9200/remote.php/dav/files/Einstein' | xmllint --format -
```
```console


/remote.php/dav/files/Einstein/


4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51
4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51
4c510ada-c86b-4815-8820-42cdf82c3d51
"4e074b7aad836f56e31ad0b73319002c"
RDNVCK



0
Thu, 29 Sep 2022 09:21:42 GMT
0

HTTP/1.1 200 OK



/remote.php/dav/files/Einstein/foo%20%281%29/


1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!e4e17bb7-63e2-4baf-8f1b-741a571d00e7
1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!e4e17bb7-63e2-4baf-8f1b-741a571d00e7
4c510ada-c86b-4815-8820-42cdf82c3d51
foo (1)
"8b14b07c504cff4d3e671f6a5189512a"
RDNVCK



0
Thu, 29 Sep 2022 09:21:42 GMT
0

HTTP/1.1 200 OK

```

## Setup

OCIS_COMMIT_ID = ceea69616675de0c36539db88ba9d7608fdbe0b7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.