cleanup, docs
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
:title
|
||||
route_path_sanitize
|
||||
|
||||
:sig
|
||||
String route_path_sanitize(String path, String default_path = "index")
|
||||
|
||||
:see
|
||||
>uri
|
||||
route_path_is_safe
|
||||
route_path_normalize
|
||||
request_query_path
|
||||
@@ -25,10 +23,8 @@ Rules:
|
||||
|
||||
Use this instead of manually checking app routes before composing file paths.
|
||||
|
||||
```cpp
|
||||
route_path_sanitize("/workspace/projects/"); // "workspace/projects"
|
||||
route_path_sanitize("../secret"); // ""
|
||||
route_path_sanitize(""); // "index"
|
||||
```
|
||||
|
||||
`request_query_path()`, `request_query_route()`, and the runtime-populated `ROUTE_PATH` params already use this sanitizer.
|
||||
|
||||
:example
|
||||
print(route_path_sanitize("../secret", "index"), "\n");
|
||||
|
||||
Reference in New Issue
Block a user