Add {url:parameter:} placeholder for extracting query parameters

This commit is contained in:
Artem Chepurnoy 2024-01-07 22:42:20 +02:00
parent 46d5fa2776
commit c8e2fab4c3
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
2 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,18 @@ class UrlPlaceholder(
.let(::io) .let(::io)
} }
key.startsWith("url:parameter:", ignoreCase = true) -> {
val name = key.substringAfter("url:parameter:")
uuu.parameters[name]
.let(::io)
}
key.startsWith("base:parameter:", ignoreCase = true) -> {
val name = key.substringAfter("base:parameter:")
uuu.parameters[name]
.let(::io)
}
key.equals("url:userinfo", ignoreCase = true) || key.equals("url:userinfo", ignoreCase = true) ||
key.equals("base:userinfo", ignoreCase = true) -> { key.equals("base:userinfo", ignoreCase = true) -> {
val user = uuu.user.orEmpty() val user = uuu.user.orEmpty()

View File

@ -65,6 +65,7 @@ Note: `{base}` supports exactly the same parts as `{url}` and is identical to it
| `url:userinfo` | User information: `user:pw` | | `url:userinfo` | User information: `user:pw` |
| `url:username` | Username: `user` | | `url:username` | Username: `user` |
| `url:password` | Password: `pw` | | `url:password` | Password: `pw` |
| `url:parameter:q` | Query parameter with a name `q`: `e` |
#### Text transformation #### Text transformation