feathersjs-ecosystem / feathers-blob

Feathers service for blob storage, like S3.
http://feathersjs.com
MIT License
92 stars 32 forks source link

Create URI from buffer only if requested #90

Closed dasantonym closed 2 years ago

dasantonym commented 2 years ago

Summary

When submitting a very large upload (~450MB) as a buffer, the create action fails with an error about max string length exceeded, even if returnUri === false.

I added an if-clause checking for returnUri before creating the uri value, thus skipping setting it if not requested through config.

Not sure if this would hurt existing configurations, but I don't see why uri would need to be set if not returned.

claustres commented 2 years ago

Thanks for this, it does not seem to break anything.

dasantonym commented 2 years ago

That was quick, thanks for merging! Now I just realised that if I disable returnUri in the service config, I'll also disable it for get()... I guess this is a different issue though, as skipping the base64-encode helps basic performance, too.

claustres commented 2 years ago

Yes at the present time this is a global option (i.e. for all service operations).

dasantonym commented 2 years ago

I made another pull request here: https://github.com/feathersjs-ecosystem/feathers-blob/pull/91

Not sure if this is something you want and if this is the proper way, but it should not break anything existing.

claustres commented 2 years ago

Yes it's better to separate concerns, thanks.