Added init_downstream_modules
phase allowing modules to be set up before startup
#284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses a roadblock I’ve hit trying to make the new downstream modules mechanism work for me: these cannot be configured from within the
HttpProxy
instance. The configuration has to happen afterhttp_proxy_service
has been called, but at this point theHttpProxy
instance has been moved into the service and is no longer accessible. In order to adjust the compression level for example some code outside the actual handler would have to mess with the service configuration which is a significant logic break.In case of compression this can be addressed by adjusting compression level in
early_request_filter
. When the handler wants to add its own module however (helps remove some work-arounds I’ve added before), this option is rather suboptimal.So I’ve added an
init_downstream_module
phase whereHttpProxy
can adjust modules to its liking.