Last week, I described the basics of how to develop and deploy a Rust plugin for Apache APISIX. The plugin just logged a message when it received the request. Today, I want to leverage what we learned to create something more valuable: write part of the response-rewrite plugin with Rust.
Adding a Hard-coded Header
Let's start small and add a hard-coded response header. Last week, we used the on_http_request_headers()
function. The proxy_wasm
specification defines several function hooks for each step in a request-response lifecycle: