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

Check trailing ";" in content type in webdav #1538

Open
tobiasKaminsky opened this issue Apr 20, 2023 · 1 comment
Open

Check trailing ";" in content type in webdav #1538

tobiasKaminsky opened this issue Apr 20, 2023 · 1 comment

Comments

@tobiasKaminsky
Copy link
Member

According to

// dvelasco: some builds of ownCloud server 4.0.x added a trailing ';'
// to the MIME type ; if looks fixed, but let's be cautious
if (contentType != null) {
if (contentType.contains(";")) {

it seems that some (old) server added a trailing ";".

Can you check and verify that this does not happen in our support server (down to NC16).

@joshtrichards
Copy link
Member

joshtrichards commented Sep 17, 2024

Talk about a needle in a haystack. 😆

Best as I can tell this was awhile back when we called file in a way that appended a semicolon to the mimetype:

https://github.com/owncloud/core/blob/249190c89bc1c2effd8aaad1052d9a0ccf0bfe37/lib/helper.php#L370-L379

We no longer call it in the same way:

https://github.com/nextcloud/server/blob/4d275232f084559935226a093f1c770e59c642c1/lib/private/Files/Type/Detection.php#L219-L235

josh@debian1:~/workspace/nextcloud/documentation$ file -i -b --mime-type go.php 
text/x-php; charset=us-ascii
josh@debian1:~/workspace/nextcloud/documentation$ file -b --mime-type go.php 
text/x-php

Seems fixed since Owncloud ~4.0.3 though the initial commits I found didn't make it clear with certainty:

owncloud/core@249190c
owncloud/core@db7542b

But further digging suggests the revert of the initial solution seems to be because it was fixed in the same way we're doing it today (by dropping the -i from the command line when using file:

https://github.com/owncloud/core/blob/2dabc647303fef1da67391d4cf5394f46240d278/lib/helper.php#L435

I suspect it's fairly safe to drop this from the client library.

@joshtrichards joshtrichards transferred this issue from nextcloud/server Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants