I'm accessing the Accept header value in filter and postFilter method.
Here's what I've experienced.
the client sends accept value as (blank)
In the filter method, set accept value, for example application/xml;charset=euc-kr, to call an upstream server with that accept header value.
In the post filter method, access accept header value. and It turns out application/xml;charset=euc-kr not a (blank)
It only happens when the client send accept header is
Here's my code
@Override
public void filter(HttpRequest request, HttpResponse response, PluginFilterChain chain) {
var config = getConfig(request.getConfig(this), ContentTypeConverterFilterConfig.class);
request.setHeader(HTTP_HEADER_ACCEPT, config.getUpstreamAccept()); // config.getUpstreamAccept() is `application/xml;charset=euc-kr`
request.setHeader(HTTP_OPENAPI_ORIGINAL_HEADER_ACCEPT,
getNonBlankHeaderValue(request.getVars(NginxVars.HTTP_ACCEPT.getValue()))); // I have to add another header value so that I can client send accept header value in postFilter method
chain.filter(request, response);
}
@Override
public void postFilter(PostRequest request, PostResponse response, PluginFilterChain chain) {
...
request.getVars(NginxVars.HTTP_ACCEPT.getValue()) // not a client send accept header value (` `)
...
}
public enum NginxVars {
HTTP_ACCEPT("http_accept"),
REQUEST_URI("request_uri");
...
Issue description
I'm accessing the Accept header value in filter and postFilter method.
Here's what I've experienced.
application/xml;charset=euc-kr
, to call an upstream server with that accept header value.application/xml;charset=euc-kr
not aIt only happens when the client send accept header is
Here's my code
Environment
0.4.0