Skip to content

Commit

Permalink
fix: update response and doc
Browse files Browse the repository at this point in the history
Signed-off-by: Martijn Swaagman <martijn@swaagman.online>
  • Loading branch information
Swaagie committed Dec 2, 2024
1 parent 22601f0 commit 2a44592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/envoy_filter_metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ and has a matching Envoy configuration.
$ docker compose up
```

Send a HTTP request to `localhost:10000/` will return the configured response.
Send a HTTP request to `localhost:10000` will return the configured response.

```sh
$ curl localhost:10000/
$ curl localhost:10000
Welcome, set the `x-custom-metadata` header to change the response!
```

Send a HTTP request to `localhost:10000/` with a `x-custom-metadata` header value to get the uppercased value in the response.
Send a HTTP request to `localhost:10000` with a `x-custom-metadata` header value to get the uppercased value in the response.
The response will also set a response header `uppercased-metadata: SOME-VALUE`.

```sh
$ curl localhost:10000/ -H "x-custom-metadata: some-value"
Custom response with Envoy metadata: "SOME-VALUE"!
$ curl localhost:10000 -H "x-custom-metadata: some-value"
Custom response with Envoy metadata: "SOME-VALUE"
```
2 changes: 1 addition & 1 deletion examples/envoy_filter_metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl HttpContext for MetadataHttp {
vec![("Powered-By", "proxy-wasm"), ("uppercased-metadata", &data)],
Some(
format!(
"Custom response with Envoy metadata: {:?}!\n",
"Custom response with Envoy metadata: {:?}\n",
data
)
.as_bytes(),
Expand Down

0 comments on commit 2a44592

Please sign in to comment.