Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/extensionserver/mutate/localreply.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func buildLocalReplyConfig(cfg *LocalReplyConfig) *hcmv3.LocalReplyConfig {
// re-trigger the exact listener rejection this escaper exists to prevent
// (issue #243). Keep entries longest-first so matching is unambiguous.
var envoyBodyAllowedCommands = []string{
"%START_TIME(%Y-%m-%d %H:%M:%S UTC)%",
"%RESPONSE_CODE_DETAILS%",
"%RESPONSE_CODE%",
}

Expand Down
2 changes: 2 additions & 0 deletions internal/extensionserver/mutate/localreply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ func TestEscapeEnvoyFormatLiterals(t *testing.T) {
{"bare percent in css", "height: 100%;", "height: 100%%;"},
{"multiple bare percents", "120% 50% 0%", "120%% 50%% 0%%"},
{"preserve allowlisted command", "code %RESPONSE_CODE% end", "code %RESPONSE_CODE% end"},
{"preserve allowlisted response code details", "details: %RESPONSE_CODE_DETAILS%", "details: %RESPONSE_CODE_DETAILS%"},
{"preserve allowlisted start time", "at %START_TIME(%Y-%m-%d %H:%M:%S UTC)%", "at %START_TIME(%Y-%m-%d %H:%M:%S UTC)%"},
{"escape non-allowlisted command", "%REQ(x-header)%", "%%REQ(x-header)%%"},
{"escape non-allowlisted command with length", "%REQ(x-header):10%", "%%REQ(x-header):10%%"},
{"escape command-shaped literal", "progress %COMPLETE% now", "progress %%COMPLETE%% now"},
Expand Down
Loading