diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-07 04:32:13 +0100 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-07 04:32:13 +0100 |
commit | a8848d4bd898a15e02a8f4210917166bca9f50b1 (patch) | |
tree | 77f3b6399fe928f456264bccdf31e5d9c2f6bb59 /docs/web/stylesheets/stylesheet.css | |
parent | 17ae1b512c386970d0f5b84b385b89749a89b1e5 (diff) |
html-error: substitute template variables via a regex
previously, in order to detect and insert {variables} into error/stats
templates, tinyproxy iterated char-by-char over the input file, and would
try to parse anything inside {} pairs and treat it like a variable name.
this breaks CSS, and additionally it's dog slow as tinyproxy wrote every
single character to the client via a write syscall.
now we process line-by-line, and inspect all matches of the regex
\{[a-z]{1,32}\}. if the contents of the regex are a known variable name,
substitution is taking place. if not, the contents are passed as-is to
the client. also the chunks before and after matches are written in
a single syscall.
closes #108
Diffstat (limited to 'docs/web/stylesheets/stylesheet.css')
0 files changed, 0 insertions, 0 deletions