theia icon indicating copy to clipboard operation
theia copied to clipboard

File download sets global limit settings

Open syncharny opened this issue 3 years ago • 2 comments

Bug Description:

the file-system package download backend application is setting the default global limit for json, so other backend applications cannot set limits for their own routes

Steps to Reproduce:

  1. Create a backend application with a json route
  2. Set the limit to more than 100KB
  3. Limit will be 100KB no matter what

Additional Information

  • Operating System: ubuntu
  • Theia Version: 1.29.0

The problem appears to be here: https://github.com/eclipse-theia/theia/blob/da356b537037680cdc7283a695ebfbf0c00d2cf1/packages/filesystem/src/node/download/file-download-endpoint.ts#L50

if it is changed to app.use(FileDownloadEndpoint.PATH, json()); then it will narrow the route that the default limit applies to and won't apply globally.

syncharny avatar Aug 28 '22 15:08 syncharny

Hey @syncharny,

thanks for making us aware of that. Are you interested in providing a fix for that?

msujew avatar Aug 29 '22 18:08 msujew

Hi, yes I'm interested in fixing it. Still going though the contributor docs.

syncharny avatar Aug 30 '22 23:08 syncharny