golemcloud / golem

Golem is an open source durable computing platform that makes it easy to build and deploy highly reliable distributed systems.
https://learn.golem.cloud/
Apache License 2.0
530 stars 59 forks source link

(Cleanup) : Introduce default middleware, and remove http specific details from generic modules #1059

Open afsalthaj opened 1 week ago

afsalthaj commented 1 week ago

Currently the logic for managing the poem::Response in a couple of places. Example: getting headers from rib_result in getter module (while getter module is a key value lookup) and this is being called from to_response module and file_server_result_handler module.

I think its understandable this can happen naturally as the code evolves that the responsibilities gets scattered across modules.

However, with the introduction of middleware and clear segregation of binding-types, we may have a way out, that we can introduce a default middleware that can handle even gateway-internal logic of transforming responses, apart from the user specified middlewares.