Commit Graph

11 Commits

Author SHA1 Message Date
Michael Hanselmann
8a0fd2acd5 Use text/template instead of html/template for config pre-processing
Commit c95311d1 added support for multiple config formats in addition to
pre-processing using Go's built-in templating system. The
`html/template` package is equivalent to `text/template`, except that
the former automatically escapes characters for inclusion in HTML.

Configurations aren't plain text, but they're also certainly no HTML.
The difference between the packages is noticeable when using `printf
"%q"` for quoting of strings. An example from the included unittest:

* `html/template`: `key = "with space"`
* `text/template`: `key = "with space"`

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2025-02-04 22:30:05 +01:00
Gabriel Marin
092e5d3f94
client, pkg, server, test: replaced 'interface{}' with 'any' (#4611) 2025-01-02 11:24:08 +08:00
fatedier
3585f5c0c0
support range ports mapping by go template (#4073) 2024-03-15 17:23:16 +08:00
fatedier
38f297a395
Improve the strict configuration validation (#3809) 2023-11-28 18:43:33 +08:00
fatedier
69ae2b0b69
optimize some code (#3801) 2023-11-27 15:47:49 +08:00
Aarni Koskela
f5d5a00eef
Fix various typos (#3783) 2023-11-22 14:30:22 +08:00
fatedier
526e809bd5
update for strict config (#3779) 2023-11-16 21:03:36 +08:00
Aarni Koskela
e8deb65c4b
Strict configuration parsing (#3773)
* Test configuration loading more precisely

* Add strict configuration parsing
2023-11-16 15:42:49 +08:00
fatedier
5e70d5bee0
code optimization (#3625) 2023-09-20 15:18:50 +08:00
fatedier
7cd02f5bd8
add e2e tests for v1 config (#3608) 2023-09-13 16:32:39 +08:00
fatedier
c95311d1a0
support yaml/json/toml configuration format, make ini deprecated (#3599) 2023-09-06 10:18:02 +08:00