Skip to content

Commit b14d556

Browse files
author
Crazy-xyr
committed
fix: translation adjustment
1 parent ca53411 commit b14d556

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

apisix/plugins/request-id.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ local schema = {
3333
include_in_response = {type = "boolean", default = true},
3434
algorithm = {
3535
type = "string",
36-
enum = {"uuid", "nanoid", "range_id","ksuid"},
36+
enum = {"uuid", "nanoid", "range_id", "ksuid"},
3737
default = "uuid"
3838
},
3939
range_id = {

docs/en/latest/plugins/request-id.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The `request-id` Plugin adds a unique ID to each request proxied through APISIX,
4040
| ------------------- | ------- | -------- | -------------- | ------------------------------- | ---------------------------------------------------------------------- |
4141
| header_name | string | False | "X-Request-Id" | | Name of the header that carries the request unique ID. Note that if a request carries an ID in the `header_name` header, the Plugin will use the header value as the unique ID and will not overwrite it with the generated ID. |
4242
| include_in_response | boolean | False | true | | If true, include the generated request ID in the response header, where the name of the header is the `header_name` value. |
43-
| algorithm | string | False | "uuid" | ["uuid","nanoid","range_id","ksuid"] | Algorithm used for generating the unique ID. When set to `uuid` , the Plugin generates a universally unique identifier. When set to `nanoid`, the Plugin generates a compact, URL-safe ID. When set to `range_id`, the Plugin generates a sequential ID with specific parameters. When set to `ksuid`, the Plugin generates a sequential ID with timestamp and randomly number. |
43+
| algorithm | string | False | "uuid" | ["uuid","nanoid","range_id","ksuid"] | Algorithm used for generating the unique ID. When set to `uuid` , the Plugin generates a universally unique identifier. When set to `nanoid`, the Plugin generates a compact, URL-safe ID. When set to `range_id`, the Plugin generates a sequential ID with specific parameters. When set to `ksuid`, the Plugin generates a sequential ID with timestamp and random number. |
4444
| range_id | object | False | | | Configuration for generating a request ID using the `range_id` algorithm. |
4545
| range_id.char_set | string | False | "abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789" | minimum length 6 | Character set used for the `range_id` algorithm. |
4646
| range_id.length | integer | False | 16 | >=6 | Length of the generated ID for the `range_id` algorithm. |
@@ -275,13 +275,13 @@ Send a request to the Route:
275275
curl -i "http://127.0.0.1:9080/anything"
276276
```
277277

278-
You should receive an `HTTP/1.1 200 OK` response and see the response includes the `X-Req-Identifier` header with an ID generated using the `ksuid` algorithm:
278+
You should receive an `HTTP/1.1 200 OK` response and see the response includes the `X-Request-Id` header with an ID generated using the `ksuid` algorithm:
279279

280280
```text
281281
X-Request-Id: 325ghCANEKjw6Jsfejg5p6QrLYB
282282
```
283283

284-
If installed [ksuid](https://github.com/segmentio/ksuid?tab=readme-ov-file#command-line-tool) command tool,This ID can be viewed through `ksuid -f inspect 325ghCANEKjw6Jsfejg5p6QrLYB`:
284+
If the [ksuid](https://github.com/segmentio/ksuid?tab=readme-ov-file#command-line-tool) is installed, this ID can be viewed through `ksuid -f inspect 325ghCANEKjw6Jsfejg5p6QrLYB`:
285285

286286
``` text
287287
REPRESENTATION:

docs/zh/latest/plugins/request-id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
271271
curl -i "http://127.0.0.1:9080/anything"
272272
```
273273

274-
您应该收到一个 `HTTP/1.1 200 OK` 响应,并看到响应包含 `X-Req-Identifier` 标头,其中的 ID 使用 `ksuid` 算法生成:
274+
您应该收到一个 `HTTP/1.1 200 OK` 响应,并看到响应包含 `X-Request-Id` 标头,其中的 ID 使用 `ksuid` 算法生成:
275275

276276
```text
277277
X-Request-Id: 325ghCANEKjw6Jsfejg5p6QrLYB

t/plugin/request-id3.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ X-Request-Id
133133
ngx.say("incorrect char set for id")
134134
ngx.say(id)
135135
return
136-
end
137-
136+
end
138137
if ids[id] == true then
139138
ngx.say("ids not unique")
140139
return

0 commit comments

Comments
 (0)