Skip to content

Commit 050140a

Browse files
authored
[WAF] Update example to use APIRequest component (#25643)
1 parent 0fe1c80 commit 050140a

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/content/docs/waf/tools/replace-insecure-js-libraries.mdx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ head:
66
content: Replace insecure JavaScript libraries
77
---
88

9-
import { GlossaryTooltip, Tabs, TabItem, Steps } from "~/components";
9+
import {
10+
GlossaryTooltip,
11+
Tabs,
12+
TabItem,
13+
Steps,
14+
APIRequest,
15+
} from "~/components";
1016

1117
This feature, when turned on, automatically rewrites URLs to external JavaScript libraries to point to Cloudflare-hosted libraries instead. This change improves security and performance, and reduces the risk of malicious code being injected.
1218

@@ -50,13 +56,16 @@ The feature is available in all Cloudflare plans, and is turned on by default on
5056

5157
Issue a `PATCH` request similar to the following:
5258

53-
```bash
54-
curl --request PATCH \
55-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/replace_insecure_js" \
56-
--header "Authorization: Bearer <API_TOKEN>" \
57-
--header "Content-Type: application/json" \
58-
--data '{ "value": "on" }'
59-
```
59+
<APIRequest
60+
path="/zones/{zone_id}/settings/{setting_id}"
61+
parameters={{
62+
setting_id: "replace_insecure_js",
63+
}}
64+
method="PATCH"
65+
json={{
66+
value: "on",
67+
}}
68+
/>
6069

6170
</TabItem> </Tabs>
6271

0 commit comments

Comments
 (0)