Explanation:
Here we are trying to extract part of the path and put that into a header but also remove that part in the path. The extraction in this mode is stored in a string_veiw that requires the backing data (in this case, the :path header string) to be unchanged.
Workaround:
1) extracting information and modifying the same header within the same stage should be discourage. The order of what happens first may not be 100% guarantee in the headers modification phase. In this case, the evidence shows that :path get modified first before host-header is created even host-header comes first in the config. So, to work around this, it's best to extract the host information in the early stage and modify :path in the regular stage:
2) If the extraction has to be in the same stage, using REPLACE_ALL mode and replacing with subgroup might be able to work around this. The following is untested:
Example gloo control plane config config that could trigger this issue:
Explanation: Here we are trying to extract part of the path and put that into a header but also remove that part in the path. The extraction in this mode is stored in a string_veiw that requires the backing data (in this case, the
:path
header string) to be unchanged.Workaround: 1) extracting information and modifying the same header within the same stage should be discourage. The order of what happens first may not be 100% guarantee in the headers modification phase. In this case, the evidence shows that
:path
get modified first beforehost-header
is created evenhost-header
comes first in the config. So, to work around this, it's best to extract the host information in theearly
stage and modify:path
in the regular stage:2) If the extraction has to be in the same stage, using
REPLACE_ALL
mode and replacing with subgroup might be able to work around this. The following is untested:Internal slack context: https://solo-io-corp.slack.com/archives/CEDCS8TAP/p1727447571096119