Skip to content

Milton CE GetableResource#sendContent() adds unwanted zero-bytes #144

@stephanrauh

Description

@stephanrauh

We've written a Webdav server using the community edition of milton2. That works great - but when we download a file, sometimes unexpected zero bytes are added.

Maybe this is caused by our encryption. We don't store the original file on the server. Instead, we encrypt it when we upload the file, and we decrypt it during the download.

Of course, encrypting the file makes it larger.

After downloading the file, we observe that the file is decrypted correctly. However, it's too large. It has the size of the encrypted file. It's filled up with zero-bytes.

It seems milton2 always makes sure that the file size is the number returned by GetableResource#getContentLength(). In our case, the number return getContentLength() is larger than the real file size. It seems milton2 sets the file size to getContentLength(). In our case, this amounts to adding the content of the empty buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions