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

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

Open
stephanrauh opened this issue Dec 14, 2020 · 1 comment
Open

Comments

@stephanrauh
Copy link

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.

@stephanrauh
Copy link
Author

@frankyhoffmann Here's the ticket we've been talking about.

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

No branches or pull requests

1 participant