rustypaste icon indicating copy to clipboard operation
rustypaste copied to clipboard

fix(server): upload limit

Open tessus opened this issue 1 year ago • 5 comments

[!CAUTION] This is PR does not work! It implements the changes suggested on SO to limit the upload file size. It is not clear whether it is really possible with actix.

Description

Update code to limit the file upload.

Motivation and Context

see #336 and https://stackoverflow.com/a/78399675

How Has This Been Tested?

It does not seem to work.

Changelog Entry

Types of Changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation (no code change)
  • [ ] Refactor (refactoring production code)
  • [ ] Other

Checklist:

Will be done after moving it out of draft status.

  • [ ] My code follows the code style of this project.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have formatted the code with rustfmt.
  • [ ] I checked the lints with clippy.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.

tessus avatar Oct 25 '24 01:10 tessus

I didn't adjust the tests, which is why the pipeline complains.

But I was testing manually and it doesn't work.

tessus avatar Oct 25 '24 01:10 tessus

Hmm, what's the status with this?

orhun avatar Dec 07 '24 15:12 orhun

This PR implements the limit as was shown at stackoverflow. You can build the app and test it. But it doesn't work. Same behavior as before, except that now you don't even get an error message after the file has been uploaded. Apparently limiting the fie upload is just not possible with this framework or every single information out there about how one can accomplish this is wrong.

You pinged the author here https://github.com/orhun/rustypaste/issues/336#issuecomment-2443504870 but nothing so far.

tessus avatar Dec 07 '24 16:12 tessus

I see. I might come back to this later then.

orhun avatar Dec 09 '24 09:12 orhun

Yea, this one is a draft and was just to show that it doesn't work as described in the stackoverflow article. We can leave it for reference for now. Who knows maybe Rob will check it out... ;-)

tessus avatar Dec 09 '24 13:12 tessus