Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions app/_how-tos/gateway/configure-conditional-plugin-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ faqs:
Add the Request Termination plugin to your Route with a `condition` expression.
In this example, the plugin only triggers when the request includes the header `x-block: true`, and blocks the request.
Requests without this header are proxied to the upstream service.

<!-- decK doesn't support this yet -->
<!-- {% entity_examples %}
{% entity_examples %}
entities:
plugins:
- name: request-termination
Expand All @@ -83,24 +81,7 @@ entities:
status_code: 403
message: "Forbidden by condition"
condition: 'http.headers.x_block == "true"'
{% endentity_examples %} -->

<!--vale off-->
{% control_plane_request %}
url: /routes/example-route/plugins
method: POST
status_code: 201
headers:
- 'Accept: application/json'
- 'Content-Type: application/json'
body:
name: request-termination
config:
status_code: 403
message: "Forbidden by condition"
condition: "http.headers.x_block == \"true\""
{% endcontrol_plane_request %}
<!--vale on-->
{% endentity_examples %}

{:.info}
> Header names are always normalized to lowercase with hyphens replaced by underscores.
Expand Down
Loading