-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
originRequestProvider
should be able to access ProxyContext
to perform routing based on modified request
#44
Comments
One way to solve this would be if we could mention which version of the request should be passed here, the proxied request or the modifies request, when resolving the origin:
|
I had the same need: sharing information between interceptors and originSelector function to perform needed routing. One option that could be interesting is that originSelector accepts Function<ProxyContext, Future> selector). It is possible to get the original request via context.request().proxiedRequest(). This way it is possible to pass information using ProxyConext get/set methods As a workaround it is possible to use request headers map of the proxiedRequests to pass Strings between interceptors and originSelector (But it is far from clean solution). The other option is obviously to write the proxy handler and not using interceptors/originin selectors and do everything in the handler. Probably this was not the original idea of the API |
Version
Since
originRequestProvider
runs after pre-request interceptors, there is no way to pass theProxyContext
to perform routing on the based on the modified request.originRequestProvider
only has context of the original request inHttpServerRequest
Context
It would be useful if
originRequestProvider
could perform routing based on what is present inProxyContext
andProxyRequest
. This may also solve #35 - variables can be set in theProxyContext
to perform routing.The drawback here would be that
originRequestProvider
must come in between pre-request and post-request interceptors.The text was updated successfully, but these errors were encountered: