frostfs-s3-gw/internal/misc/sanitizer.go
Alex Vanin 12d9eb62cb [#489] Sanitize log records that may contain user input
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2022-06-02 19:42:31 +04:00

9 lines
244 B
Go

package misc
import "strings"
// SanitizeString sanitizes string before using it in logs. Required
// for data from the user input: request body, headers, etc.
func SanitizeString(s string) string {
return strings.Replace(s, "\n", "", -1)
}