<p><br />
In application's responses we see doubled <em>transfer-encoding</em> headers. <br />
Suppose, because of that we get 503 in UI, but at the same time application returns 201 in pod's logs. <br />
Except <code>http code: 201</code> there are <code>transfer-encoding=chunked</code> and <code>Transfer-Encoding=chunked</code> headers in logs, so that could be a reason of 503. <br />
We've tried to remove <code>transfer-encoding</code> via Istio virtual service or envoy filter, but no luck..</p>
<p>Here are samples we tried:</p>
<p>VS definition:</p>
<pre><code>kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: test
  namespace: my-ns
spec:
  hosts:
    - my-service
  http:
    - route:
        - destination:
            host: my-service
          headers:
            response:
              remove:
                - transfer-encoding

---
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: test
  namespace: istio-system
spec:
  gateways:
    - wildcard-api-gateway
  hosts:
    - my-ns_domain
  http:
    - match:
        - uri:
            prefix: /operator/api/my-service
      rewrite:
        uri: /my-service
      route:
        - destination:
            host: &gt;-
              my-service.my-ns.svc.cluster.local
            port:
              number: 8080
          headers:
            response:
              remove:
                - transfer-encoding
</code></pre>
<p>EnvoyFilter definition:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: test
  namespace: istio-system
spec:
  configPatches:
  - applyTo: HTTP_FILTER
    match:
      context: SIDECAR_OUTBOUND
    patch:
      operation: ADD
      value:
        name: envoy.filters.http.lua
        typed_config:
          &quot;@type&quot;: &quot;type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua&quot;
          inlineCode: |
           function envoy_on_response(response_handle)
             response_handle:headers():remove(&quot;transfer-encoding&quot;)
           end
</code></pre>
<p>In older envoy versions I see <code>envoy.reloadable_features.reject_unsupported_transfer_encodings=false</code> was a workaround. Unfortunately, it was deprecated.</p>
<p>Please advise what is wrong with VS/filter or is there any alternative to <code>reject_unsupported_transfer_encodings</code> option?</p>
<p>Istio v1.8.2 <br />
Envoy v1.16.1</p>

Eugene G
<p>Decision so far: created requirement for dev team to remove the duplication of chunked encoding</p>
