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.
Currently the logic for managing the
poem::Response
in a couple of places. Example: getting headers fromrib_result
ingetter
module (while getter module is a key value lookup) and this is being called fromto_response
module andfile_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.