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

tests expect a wrong filename param in content-disposition #10110

Open
butonic opened this issue Sep 19, 2024 · 0 comments
Open

tests expect a wrong filename param in content-disposition #10110

butonic opened this issue Sep 19, 2024 · 0 comments
Labels

Comments

@butonic
Copy link
Member

butonic commented Sep 19, 2024

While looking at #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         = <token, defined in [RFC2616], Section 2.2>
     quoted-string = <quoted-string, defined in [RFC2616], Section 2.2>
     value         = <value, defined in [RFC2616], Section 3.6>
                   ; token | quoted-string

    quoted-string  = ( <"> *(qdtext | quoted-pair ) <"> )
    qdtext         = <any TEXT except <">>
    
    quoted-pair    = "\" CHAR

qdtext must not contain any ". if so they must be quoted: \":

-       | 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Qualification
Development

No branches or pull requests

1 participant