tests expect a wrong filename param in content-disposition
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
While looking at https://github.com/owncloud/ocis/pull/10103 I saw that the tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature expects `filename=""quote"double".txt"`:
```
| Content-Disposition | attachment; filename*=UTF-8''%22quote%22double%22.txt; filename=""quote"double".txt" |
```
That is actually wrong. Here is the chain of
```
filename-parm = "filename" "=" value
| "filename*" "=" ext-value
Defined in [RFC2616]:
token =
quoted-string =
value =
; token | quoted-string
quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
qdtext = >
quoted-pair = "\" CHAR
```
`qdtext` must not contain any `"`. if so they must be quoted: `\"`:
```diff
- | Content-Disposition | attachment; filename*=UTF-8''%22quote%22double%22.txt; filename=""quote"double".txt" |
+ | Content-Disposition | attachment; filename*=UTF-8''%22quote%22double%22.txt; filename="\"quote\"double\".txt" |
```
this should be tackled in a separate PR. The code needs to be fixed in reva, similar to https://github.com/cs3org/reva/pull/4748/files#diff-76bd77409b0be83f0ccc7c348bfc5c4552547e7320d85b87eb70c2e490fe971fR31 ... but leave `filename*` as it is. That PR is a proper fix for it.
Contributor guide
Assessment
This issue has not been assessed yet.