File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -905,6 +905,25 @@ Built-in helpers:
905905 opened and closed per request, and the handler owns its lifecycle). Throws
906906 ` IllegalArgumentException` at construction if the resource or file is missing.
907907
908+ # ## Wildcards in extra routes
909+
910+ Extra routes accept two wildcard tokens (these are *not* part of OpenAPI;
911+ they apply only to extras, which are outside the spec) :
912+
913+ - ` *` — matches exactly one path segment (no `/`).
914+ - ` **` — matches zero or more characters, may cross `/` boundaries.
915+
916+ Both must appear as whole segments (`/files/*`, `/files/**`,
917+ ` /schemas/**/openapi.yaml` ). Mixed-segment patterns like `prefix-*.json`
918+ are rejected at boot.
919+
920+ The matched portion is not exposed to the handler. If you map a wildcard
921+ extra to a filesystem location, canonicalise via `Path.toRealPath()` and
922+ assert `resolved.startsWith(baseReal)` to prevent escape — the router
923+ blocks `.`, `..`, encoded `%2e`/`%2f`/`%5c`/`%00`, control characters and
924+ malformed encoding with a 400, but cannot police what the handler does
925+ with the matched path.
926+
908927# ## Health endpoint
909928
910929` Handlers.healthHandler(probe)` mounts a readiness endpoint that aggregates per-dependency
You can’t perform that action at this time.
0 commit comments