Open dandan2095 opened 2 years ago
I'm trying to add a local response if there is no response body originally. My config is as below, but it doesn't seem to work very well. Is there an easy way to match a no-body response?
{ "local_reply_config":{ "mappers":[ { "filter":{ "and_filter":{ "filters":[ { "status_code_filter":{ "comparison":{ "op":"GE", "value":{ "runtime_key":"400" } } } }, { "or_filter":{ "filters":[ { "header_filter":{ "header":{ "name":"content-length", "present_match":false } } }, { "and_filter":{ "filters":[ { "header_filter":{ "header":{ "name":"content-length", "present_match":true } } }, { "header_filter":{ "header":{ "name":"content-length", "string_match":{ "exact":"0" } } } } ] } } ] } }, { "or_filter":{ "filters":[ { "header_filter":{ "header":{ "name":"Transfer-Encoding", "present_match":false } } }, { "and_filter":{ "filters":[ { "header_filter":{ "header":{ "name":"Transfer-Encoding", "present_match":true } } }, { "header_filter":{ "header":{ "name":"Transfer-Encoding", "string_match":{ "exact":"chunked" }, "invert_match":true } } } ] } } ] } } ] } }, "body_format_override":{ "text_format_source":{ "inline_string":"%RESP(message)%" } } } ] } }
FIY: I'm using envoy 1.20.1
I'm trying to add a local response if there is no response body originally. My config is as below, but it doesn't seem to work very well. Is there an easy way to match a no-body response?