WebAssembly¶
In this scenario we demonstrate how to apply a wasm extension to an HttpRoute.
You will apply an extension policy that references a simple, pre-built wasm plugin to the HttpRoute for the httpbin
sample application.
The basic logic of the plugin is to inject arbitrary, configurable headers into HTTP responses on the associated route.
Context¶
httpbin
is already deployed to the default
namespace and the simple HttpRoute is already defined for it.
Instructions¶
-
Send a test request to the
httpbin
route:The request should succeed, and return some json.
Note the headers in the HTTP response.
-
Review the following extension policy:
Apply the policy:
-
Repeat the request:
Note the response headers contain extra headers from the configuration of the wasm plugin.