orangeCatDeveloper opened a new pull request, #4334:
URL: https://github.com/apache/hertzbeat/pull/4334
Part of #1525
Time expressions like `${@date-1d}` work in an HTTP monitor's query params
and payload, but not in the request path or header values - there they are sent
to the target verbatim.
## What's changed?
Run the request path (URL) and header values through the same
`TimeExpressionUtil.calculate()` that query params and payload already use.
Strings without a `${@...}` placeholder are returned unchanged, so ordinary
URLs and headers are unaffected.
Scope note: this only extends the existing time-expression support (added in
#2009). The original issue also asks for a general expression engine
(arithmetic, functions) - that involves sandboxing user-supplied expressions
and is out of scope here.
## Checklist
- [x] I have read the [Contributing
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
- [x] I have written the necessary doc or comment.
- [x] I have added the necessary unit tests and all cases have passed.
## Add or update API
- [ ] I have added the necessary [e2e
tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have
passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]