2

I have deployed a spring boot application in the Kubernetes cluster and configured the Istio controller. When I hit the request from the client, the client sends the content-type header multiple times. But envoy is merging all the duplicate headers into single header with comma-separated values like application/json; charset=UTF-8,application/json; charset=UTF-8,application/json. Because of this header change, application server throws Invalid mime type exception. To avoid this issue, we need to configure envoy.reloadable_features.http_match_on_all_headers as false.

Ref: https://github.com/istio/istio/issues/30470#issuecomment-774134780 https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.15.1

Can someone guide me on how to configure this property in Istio?

SpringBoot stacktrace:

Exception: class org.springframework.web.HttpMediaTypeNotSupportedException: Invalid mime type "application/json; charset=UTF-8,application/json; charset=UTF-8,application/json": UTF-8,application/json: null: org.springframework.web.HttpMediaTypeNotSupportedException: Invalid mime type "application/json; charset=UTF-8,application/json; charset=UTF-8,application/json": UTF-8,application/json
    at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleNoMatch(RequestMappingInfoHandlerMapping.java:211)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:422)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:368)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:65)
    at org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:401)
    at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1231)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1014)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:919)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:663)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
Dinesh Kumar
  • 483
  • 8
  • 24
  • Please include your Istio config files in the question. –  Aug 09 '21 at 06:41
  • @PawełGrondal updated my question. Can you please check – Dinesh Kumar Aug 09 '21 at 16:24
  • I asked you to include the files you used to configure the istio controller. Please include them in your question. Doing this will make it easier to troubleshoot your issue. [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) –  Aug 10 '21 at 08:44

1 Answers1

0

I solved the problem with another temporary solution. traffic.sidecar.istio.io/excludeOutboundIPRanges

cobb
  • 1