Expand description
The echo node — replaces or wraps the response body and adds response
headers. A response-phase node: place it after upstream (between
upstream and client) so it sees the upstream response.
Port of APISIX’s echo plugin (which APISIX itself documents as a
demo/util plugin). before_body/body/after_body map to APISIX’s
body_filter behavior and headers to its header_filter behavior.
Structs§
- Echo
Plugin - Rewrites the response:
bodyreplaces the upstream body, thenbefore_body/after_bodyare concatenated around it, andheadersare set on the response (replacing any existing values, likengx.header[...]).
Functions§
- optional_
string 🔒 - Reads an optional string key, rejecting non-string values.