Closed Eosis closed 1 month ago
CI Failure seems to be related to how I have exposed this. I will wait for general feedback on the PR before I dive into fixing that.
I've switched to using a method on the S3Error type rather than exposing it at the top level. Let me know what you think. :+1:
Description
As part of work I have done recently to prevent un-bounded memory growth in s3s, I put a basic middleware in front of my service that checks the signature mechanism and content-length, denying requests that will incur massive memory usage.
In doing this, I realized I would need to write my own serialization to send the error response using Hyper. This PR exposes the internal
serialize_error
method so it can used in consumer's middleware.I was not quite sure how you would prefer this to be exposed / if you think this is a good idea at all. Let me know your thoughts / suggestions.
Caveats
This is currently built atop the PR I opened earlier, #156 .
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.