feat(ui): Implement parameter to hide URL from results (#294)
* Add support for HideURL UI config parameter * Redact whole URL when hide-url parameter is set to true * Add integration test for hide-url functionality * Document the hide-url config parameter in README * Apply suggestions from code review Co-authored-by: TwiN <twin@linux.com> * Update test to have client config with 1ms timeout * Re-align README tables * Update core/endpoint_test.go * Update core/endpoint_test.go Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
@ -224,6 +224,11 @@ func (endpoint *Endpoint) EvaluateHealth() *Result {
|
||||
// No need to keep the body after the endpoint has been evaluated
|
||||
result.body = nil
|
||||
// Clean up parameters that we don't need to keep in the results
|
||||
if endpoint.UIConfig.HideURL {
|
||||
for errIdx, errorString := range result.Errors {
|
||||
result.Errors[errIdx] = strings.ReplaceAll(errorString, endpoint.URL, "<redacted>")
|
||||
}
|
||||
}
|
||||
if endpoint.UIConfig.HideHostname {
|
||||
for errIdx, errorString := range result.Errors {
|
||||
result.Errors[errIdx] = strings.ReplaceAll(errorString, result.Hostname, "<redacted>")
|
||||
|
Reference in New Issue
Block a user