Skip to content

Commit 09940b4

Browse files
committed
Return the entire req struct with extra fields
1 parent c00eedd commit 09940b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugin/plugin.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,9 @@ func (p *Plugin) OnTrafficFromClient(
135135
if response != "" {
136136
CacheHitsCounter.Inc()
137137
// The response is cached.
138-
return structpb.NewStruct(map[string]interface{}{
139-
"terminate": true,
140-
"response": response,
141-
})
138+
req.Fields["response"] = structpb.NewStringValue(response)
139+
req.Fields["terminate"] = structpb.NewBoolValue(true)
140+
return req, nil
142141
}
143142
}
144143

0 commit comments

Comments
 (0)