Commit 3b8aadd
committed
feat: add URI length guard to UriTemplate.match()
Adds a max_uri_length keyword argument (default 64 KiB) that returns
None for oversized inputs before regex evaluation. Guards against
resource exhaustion from pathologically long URIs, particularly on
stdio transport where there is no inherent message size limit.
Consistent with the existing max_length/max_expressions limits on
parse(); the default is exported as DEFAULT_MAX_URI_LENGTH.1 parent b278925 commit 3b8aadd
File tree
2 files changed
+30
-3
lines changed2 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
333 | 334 | | |
334 | 335 | | |
335 | 336 | | |
336 | | - | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
375 | | - | |
376 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
377 | 382 | | |
| 383 | + | |
| 384 | + | |
378 | 385 | | |
379 | 386 | | |
380 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
430 | 450 | | |
431 | 451 | | |
432 | 452 | | |
| |||
0 commit comments