android-library icon indicating copy to clipboard operation
android-library copied to clipboard

Check trailing ";" in content type in webdav

Open tobiasKaminsky opened this issue 2 years ago • 1 comments

According to https://github.com/nextcloud/android-library/blob/a57fce64c1ead1638966bb9c478c6adba1f374a8/library/src/main/java/com/owncloud/android/lib/common/network/WebdavEntry.java#L186-L189 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).

tobiasKaminsky avatar Apr 20 '23 06:04 tobiasKaminsky

Talk about a needle in a haystack. :laughing:

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:

https://github.com/owncloud/core/commit/249190c89bc1c2effd8aaad1052d9a0ccf0bfe37 https://github.com/owncloud/core/commit/db7542b640d092ec22fef28c1c25c32edecc36b2

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 avatar Sep 17 '24 14:09 joshtrichards