Commit 6f8bc94
committed
fix(e2e): simplify lua filter context script to use response_handle:filterContext() directly
The previous script had a nil-value bug:
- ctx["custom_value"] returns nil when filterContext() wraps an empty struct
- Storing nil via dynamicMetadata and then using it in headers():add() caused
a silent Lua error, so the response header was never set
Fix by calling response_handle:filterContext() directly in envoy_on_response,
which is available on both request and response handles per Envoy's C++ source.
Also add a nil guard for val before calling headers():add() to be safe.
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>1 parent 414db72 commit 6f8bc94
1 file changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 92 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
| |||
0 commit comments