Visitar URL original
Check trailing ";" in content type in webdav · Issue #1538 · nextcloud/android-library · GitHub
Skip to content

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

Open

Description

@tobiasKaminsky

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

Activity

  1. joshtrichards commented on Sep 17, 2024

    @joshtrichards
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions