-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorquestionGeneral usage or 'how-to' questionsGeneral usage or 'how-to' questions
Description
I need to sign the content of body, then add to head.
The signKey is different for each different user.
So i need to pass signKey to SignRequestInterceptor, the signKey is context.
there is context concept in WebClient, can be retrive in any part of the procedue.
q1:
In feign, is there any official way to save the context?
q2:
We could use header as the context, but the defaultRequestHeaders
is added as interceptor after the requestInterceptors
.
so we can't get the head in requestInterceptors
.
Can feign fix it, change the order?
defaultRequestHeaders:
APP_ID: 123
APP_KEY: abc
requestInterceptors:
- club.AuthRequestInterceptor
FeignClientFactoryBean.configureUsingProperties:
if (config.getRequestInterceptors() != null && !config.getRequestInterceptors().isEmpty()) {
// this will add request interceptor to builder, not replace existing
for (Class<RequestInterceptor> bean : config.getRequestInterceptors()) {
RequestInterceptor interceptor = getOrInstantiate(bean);
builder.requestInterceptor(interceptor);
}
}
....
/
addDefaultRequestHeaders(config, builder);
Metadata
Metadata
Assignees
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorquestionGeneral usage or 'how-to' questionsGeneral usage or 'how-to' questions